Giter VIP home page Giter VIP logo

scala-migrations's People

Contributors

googlecodeexporter avatar

Watchers

 avatar  avatar

scala-migrations's Issues

Enhancement: Create/Drop Sequence

Ability to create and drop sequences would be a small convenience.

Original issue reported on code.google.com by jzaugg on 24 Mar 2010 at 1:19

Test suite to run against different databases

Extend the test suite to run against different databases.  Properties, such as 
the following could be 
set to override the default use of Derby:
    migrations.test.schema_name
    migrations.test.driver
    migrations.test.jdbc_url
    migrations.test.username
    migrations.test.password

Original issue reported on code.google.com by [email protected] on 1 Aug 2009 at 9:36

Generated SQL to drop column invalid for Oracle

What steps will reproduce the problem?
1. dropColumn("MY_TABLE", "MY_COL") against Oracle.
2. generated SQL of [ALTER TABLE "MY_TABLE" DROP "MY_COL"] generates
"ORA-00905: missing keyword"

What is the expected output? What do you see instead?

Correct SQL for Oracle is one of:

[ALTER TABLE "MY_TABLE" DROP COLUMN "MY_COL"]
[ALTER TABLE "MY_TABLE" DROP ("MY_COL")]

What version of the product are you using? On what operating system?

migrations_2.8.0.Beta1
1.0.0

Please provide any additional information below.

Workaround is to use execute() method directly.

Original issue reported on code.google.com by jzaugg on 29 Mar 2010 at 10:30

Mavenizing source code

Is smbd interested in mavenizing source codes of scala migrations? I think, it 
may be useful for project. I did it for myself and can post here pom-file and 
changes

Nicholas

Original issue reported on code.google.com by [email protected] on 16 Jul 2010 at 1:33

Scala Migrations 2.8.0.beta1 and Scala Library 2.8.0.final aren't compatible

It appears that Scala Migrations 2.8.0.beta1 and Scala Library 2.8.0.final 
aren't compatible as the simple migrations discovery fails with method not 
found error.

After initial analysis it looks like Shrinkable interface was changed since the 
time Scala Migrations 2.8.0.beta1 was compiled.

See revision 21285 at 
https://codereview.scala-lang.org/fisheye/browse/scala-svn/scala/trunk/src/libra
ry/scala/collection/generic/Shrinkable.scala

Original issue reported on code.google.com by mikhail.krivoshein on 13 Oct 2010 at 5:39

Redesign unit tests to leave database in pristine state

Have each unit test method leave the database in a pristine state so that the 
next unit test runs in 
an empty database.  The current unit tests set up a brand new Derby database 
for each test so there 
is no need to clean up after a test, but if an Oracle or PostgreSQL schema is 
used for testing, then 
the same schema must be reused, so each test should clean up after itself.

One way of doing this is to have each test put a list of table names into a 
private class var that is 
used by the @After method that can drop them all.  JUnit needs to be checked if 
it does run an 
@After method after a test failure.

Original issue reported on code.google.com by [email protected] on 1 Aug 2009 at 9:37

How to delete a migration?

1. Create amigration
2. Run InstallAllMigrations 
3. Delete migration from FS
4. Re-run InstallAllMigrations

I get the message: The migration version XXX is installed but there is no 
migration class available to back it out.

We use the 1.0.o version.

How is possible to remove a migration? what is the right procedure to follow?



Original issue reported on code.google.com by [email protected] on 24 Nov 2011 at 10:55

Migrations can't be find when inside a jar, where jar is located under a path with sapces in it

To reproduce the problem:
1. But the Migration classes into a Jar file
2. Store the Jar file under a path with space in the path (e.g. C:\Documents 
and Settings\....) 

The Migratens can't be found in the jar file store under a path with spaces. 
I'm getting this exception:
[error] Test 
fullSurrenderTest(com.efgfp.omega.guaranteedata.GuaranteeDataServiceTest) 
failed: 
C:\Documents%20and%20Settings\chzrhfpbuild\.ivy2\cache\xxx\database-migrator\jar
s\database-migrator-1.0.0.beta.jar (The system cannot find the path specified)
[error]     at java.util.zip.ZipFile.open(Native Method)
[error]     at java.util.zip.ZipFile.<init>(ZipFile.java:114)
[error]     at java.util.jar.JarFile.<init>(JarFile.java:133)
[error]     at java.util.jar.JarFile.<init>(JarFile.java:84)
[error]     at 
com.imageworks.migration.Migrator$.classNamesInJar(Migrator.scala:108)
[error]     at 
com.imageworks.migration.Migrator$.classNamesInResource(Migrator.scala:209)
[error]     at 
com.imageworks.migration.Migrator$.com$imageworks$migration$Migrator$$findMigrat
ions(Migrator.scala:277)
[error]     at 
com.imageworks.migration.Migrator$$anonfun$migrate$1.apply(Migrator.scala:722)
[error]     at 
com.imageworks.migration.Migrator$$anonfun$migrate$1.apply(Migrator.scala:705)
[error]     at 
com.imageworks.migration.Migrator$$anonfun$withLoggingConnection$1.apply(Migrato
r.scala:493)
[error]     at 
com.imageworks.migration.Migrator$$anonfun$withLoggingConnection$1.apply(Migrato
r.scala:492)
[error]     at 
com.imageworks.migration.ConnectionBuilder.withConnection(ConnectionBuilder.scal
a:129)
[error]     at 
com.imageworks.migration.Migrator.withLoggingConnection(Migrator.scala:492)
[error]     at com.imageworks.migration.Migrator.migrate(Migrator.scala:705)

The problem is the %20 in the path to the jar file!

I tracked down the problem to Migrator.classNamesInJar() (line 108). The url is 
encoded and contains "%20" instead of " ".
The problem could be solved by first decoding the path 
(java.net.URLDecoder.decoder()).

I'm using "com.googlecode" % "scala-migrations_2.9.0-1" % "1.0.1"

Thank you for your help!


Original issue reported on code.google.com by [email protected] on 14 Oct 2011 at 12:15

can't find migrations if test src and main src have the same package name in a mvn project

What steps will reproduce the problem?

1. have a migrations .scala in a certain package
2. have any test .scala file in a package with the same name of the migrations' 
package
3. calling migrator,migrate won't find the migrations .scala file - it tries to 
find the file in the package at the test src, instead of the main src


What is the expected output? What do you see instead?

migrator,migrate should work


What version of the product are you using? On what operating system?

1.0.1-2.8.1 on an ubuntu machine


Please provide any additional information below.

This all is happening when running tests that execute a migrator,migrate, in a 
maven build. For now, I'm avoiding the problem by not having the duplicate 
package naming.

Original issue reported on code.google.com by [email protected] on 18 May 2011 at 4:10

Add support for Derby 1.7's BOOLEAN type

According to http://db.apache.org/derby/releases/release-10.7.1.1.cgi, Derby 
1.7 now supports a BOOLEAN data type.

Determine how to handle this.  Should Scala Migrations still always throw an 
UnsupportedColumnTypeException for any Derby database or should it check if 
Derby supports BOOLEAN and use it if it is available?  This could be confusing 
if somebody writes an application on a newer Derby version and then tries to 
run it on an older version.  However, another way to look at it is to treat 
each major database version as a separate database type, in which case it's not 
an issue.  For example, treat the difference between Derby 1.6 and 1.7 the same 
way we treat between Derby and PostgreSQL.

A better way than checking Derby's version number is to use 
DatabaseMetaData.getTypeInfo() which should show that the database supports 
BOOLEAN.  See https://issues.apache.org/jira/browse/DERBY-4730 .

Original issue reported on code.google.com by [email protected] on 10 Feb 2011 at 6:30

Add vendor-specific and custom column types support

It is probably a good idea to add support for vendor specific column types. 
Currently TableDefinition assumes that any column type can be defined by using 
sealed SqlType.

Also it might be a good idea to support custom data types as many databases 
support them.

What version of the product are you using? On what operating system?

1.0.0-2.8.0.final

Original issue reported on code.google.com by mikhail.krivoshein on 28 Oct 2010 at 10:02

Add DATE and TIME column types support

Please, add DATE and TIME column types support.
Both are part of SQL-92 (http://en.wikipedia.org/wiki/SQL-92).

Current version doesn't have any of two, it only has a TIMESTAMP.

sealed abstract class SqlType

case object BigintType extends SqlType
case object BlobType extends SqlType
case object BooleanType extends SqlType
case object CharType extends SqlType
case object DecimalType extends SqlType
case object IntegerType extends SqlType
case object SmallintType extends SqlType
case object TimestampType extends SqlType
case object VarbinaryType extends SqlType
case object VarcharType extends SqlType

What version of the product are you using? On what operating system?
1.0.0-2.8.0.final

Original issue reported on code.google.com by mikhail.krivoshein on 28 Oct 2010 at 9:58

Pull request: Merge H2 support

I have a patch for scala-migrations which adds support for H2.  I also modified 
the unit tests to allow them to run against different databases.  Oh yeah, and 
the unit tests pass when run against H2 (except for the grant_and_revoke, which 
was too Derby specific for me to fool with).

My patch can be found in the scala-2.8 branch on 
https://leedm777-h2.googlecode.com/hg/.

See http://www.h2database.com for more information on H2.

--
Initial support for H2.

 * Added H2DatabaseAdapter, and corresponding classes.
 * Added lockTableSql method to DatabaseAdapter, since H2 lacks a
   LOCK TABLE command.* Adapted unit tests so unit test database is configurable.  Currently
   runs with only H2 and Derby.
 * Changed grant_and_revoke test so it only runs on Derby, since the
   migrations have Derby specific code in them.

Original issue reported on code.google.com by [email protected] on 9 Feb 2011 at 11:15

Add dry-run

It would be useful if the migration could just print the SQL it would run 
without actually running it.

Original issue reported on code.google.com by [email protected] on 1 Aug 2009 at 9:34

Add/remove primary key

Expand Migration with addPrimaryKey and removePrimaryKey methods which would be 
alike addIndex and removeIndex.

Something like:

  def addPrimaryKey(table_name: String,
               column_names: Array[String],
               options: PrimaryKeyOption*): Unit

  def addPrimaryKey(table_name: String,
               column_name: String,
               options: PrimaryKeyOption*): Unit

  def removePrimaryKey(table_name: String, options: PrimaryKeyOption*): Unit

As for options Name should extend PrimaryKeyOption trait the way how it does 
for IndexOption and ForeignKeyOption traits.

Original issue reported on code.google.com by mikhail.krivoshein on 6 Sep 2010 at 3:56

Support for constraints as part of TableDefinition

In DB2 if table's primary key contains multiple columns it is not possible to 
use PRIMARY KEY modifier in the column's definition but rather one must declare 
a constraint as a part of the CREATE TABLE statement:

CREATE TABLE DUMMY
(
    ID         BIGINT      NOT NULL,
    ID_TYPE    VARCHAR(10) NOT NULL,
    CONSTRAINT PK_DUMMY PRIMARY KEY (ID,ID_TYPE)
)

At present TableDefinition may only contain columns and even more it cannot be 
subclassed to solve the problem as toSql() is declared final.

As per my knowledge similar functionality exists in Oracle database and 
probably other databases.

It would be good to make TableDefinition extendable so that database specific 
extensions may be utilized.

Context:
DB2 9.5 for Linux
scala migrations 1.0.0 for 2.7.7 jdbc3

Original issue reported on code.google.com by mikhail.krivoshein on 6 Sep 2010 at 1:30

quoteIndexName() extension point within DatabaseAdapter

Add quoteIndexName() to the DatabaseAdapter class and use it instead of 
quoteColumnName() to encode index names within Migration class.

In DB2 when creating index one is expected to specify schema name. Without such 
extension point it isn't possible to create Db2DatabaseAdapter as per my 
understanding.

Context:
DB2 9.5 for Linux
scala migrations 1.0.0 for 2.7.7 jdbc3

Original issue reported on code.google.com by mikhail.krivoshein on 6 Sep 2010 at 11:40

Add ability to change a column to a different type

Currently there is no support for changing a column to a different type.  This 
may be better being 
left unimplemented and a migration can add a new column with a different name, 
drop the old 
column and then rename the new column to the old column's name.

Original issue reported on code.google.com by [email protected] on 1 Aug 2009 at 9:33

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.