-
Notifications
You must be signed in to change notification settings - Fork 15
/
CHANGES
209 lines (165 loc) · 8.77 KB
/
CHANGES
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
Version 1.1.1 - January 1st, 2013
* Use slf4j-api as a library dependency and slf4j-log4j12 as a unit
testing dependency. Using slf4j-log4j12 as a library dependency
required that dependent libraries and applications load
slf4j-log4j12 which defeats the purpose of SLF4J. Closes
https://github.com/blair/scala-migrations/issues/1 .
* Enable unit testing on PostgreSQL when the Java
"scala-migrations.db.vendor" property is set to "postgresql".
Patches by Alan LaMielle.
Version 1.1.0 - December 28th, 2012
* Migration adds #databaseVendor to get the database vendor which
can be used for pattern matching for database specific code.
* Add an AutoIncrement column option which is supported on Derby,
MySQL and PostgreSQL for the SMALLINT, INTEGER and BIGINT column
data types. It instructs the database to provide an
auto-incrementing default value if the application does not
provide one when inserting a new row to the table.
Derby:
Only supported on SMALLINT, INT and BIGINT data types using
Derby's GENERATED BY DEFAULT AS IDENTITY. The alternate setting
GENERATED ALWAYS AS IDENTITY is not used as it is not consistent
with MySQL and PostgreSQL which permits the application to
explicitly specify the column's value.
http://db.apache.org/derby/docs/10.9/ref/rrefsqlj37836.html
MySQL:
Only supported on SMALLINT, INT and BIGINT data types using
MySQL's AUTO_INCREMENT keyword.
http://dev.mysql.com/doc/refman/5.5/en/create-table.html
http://dev.mysql.com/doc/refman/5.5/en/example-auto-increment.html
PostgreSQL:
Only supported on SMALLINT, INT and BIGINT data types by
replacing the data type name with SMALLSERIAL, SERIAL and
BIGSERIAL, respectively. Support for SMALLSERIAL is only
available in PostgreSQL 9.2 and greater.
http://www.postgresql.org/docs/9.2/static/datatype-numeric.html#DATATYPE-SERIAL
Oracle:
No support is provided in this commit as it appears that
equivalent functionality can only be provided by using triggers.
* Add support for MySQL:
- MySQL database adapter used if the JDBC driver class is named
com.mysql.jdbc.Driver.
- For grant and revoke operations, generalize the concept of a
user to support MySQL style accounts, e.g. `username`@`hostname`.
An abstract User base class with two concrete subclasses,
PlainUser and MysqlUser, was added. String usernames,
e.g. "foobar", used on MySQL are converted to the same user from
localhost, e.g. `foobar`@`localhost`, as this is the most secure
default. If database specific usernames are required, pattern
match on the database vendor:
def up() {
val user = databaseVendor match {
case Mysql => MysqlUser("foobar", "%")
case _ => PlainUser("foobar")
}
...
...
}
- Generalize the SQL that drops a drop foreign key constraint.
- Generalize the character used to quote an identifier; MySQL uses '`'.
- Generalize for databases which do not have table and column
constraints, e.g. MySQL.
- Add support for character sets having a collation.
- The Unicode case object specifies the "utf8" character set with
the "utf8_unicode_ci" collation. For an explanation why this
slower collation is used instead the "utf8_general_ci"
collation, which is MySQL's default collation for the "utf8"
character set, see http://stackoverflow.com/questions/766809/ .
- Unit tests run on MySQL.
* On Derby:
- A limit on the BLOB data type is now reflected in the generated
SQL passed to Derby.
- A limit on a TIMESTAMP is now not passed to Derby since Derby
does not support it.
- Unit tests now use an in memory database for faster turnaround.
* On PostgreSQL:
- Default values on the BLOB and VARBINARY data types are now
reflected in the generated SQL passed to PostgreSQL.
* To support PostgreSQL's ability to grant and revoke privileges on
schemas and its USAGE privilege, the following was done:
- Add a new sealed base Privilege trait that is the super-trait to
all privileges.
- Add a new sealed SchemaPrivilege trait that extends Privilege.
- Add a new UsagePrivilege case object that extends SchemaPrivilege.
- The existing GrantPrivilegeType trait now also extends Privilege.
- The existing AllPrivileges case object now also extends SchemaPrivilege.
- Migration adds #grantSchemaPrivilege() and #revokeSchemaPrivilege()
to add or remove privileges from a schema.
Patches by Alan LaMielle.
* The With.*() methods properly handle the closure argument and/or
close() throwing exceptions; functionality inspired by Java 7's
try-with-resources where an exception thrown by closer is not
suppressed if the body did not throw an exception. This ensures
that the caller always is thrown an exception if one occurred.
http://docs.oracle.com/javase/specs/jls/se7/html/jls-14.html#jls-14.20.3
* Scala 2.10.0:
- Add support for 2.10.0.
- Explicitly type exception classes in exception catching pattern
matches. When catching Throwable always log it or rethrow it.
- Fix minor bugs caught by Scala 2.10.0 compiler.
* Code style cleanups to better match the Scala style guide:
http://docs.scala-lang.org/style/scaladoc.html
Version 1.0.3 - September 21st, 2012
* Make log4jdbc optional by checking for it at runtime and using it
if it is available. This is to workaround log4jdbc not present in
any public Maven repositories, to make it easier for developers
using build tools with automatic dependency resolution so they do
not have to download log4jdbc themselves:
http://code.google.com/p/log4jdbc/wiki/FAQ
http://code.google.com/p/log4jdbc/issues/detail?id=19
* For Scala 2.8.0 and greater, switch from ant/ivy to sbt to build
the project. In addition to reducing the number of files checked
into source control to build the project, it also supports easy
publishing to Sonatype's open-source repository.
Version 1.0.2 - November 8th, 2011
* Issue #22: use java.lang.ClassLoader#getResources() instead of
#getResource() in case there are multiple resources with the same
package name. Now all resources providing the package name are
searched.
* Issue #23: fix a bug by URL decoding resource URLs so that
resources in directories containing one or more space characters
can be found.
Version 1.0.1 - February 14th, 2010
* New method Migration#alterColumn() which allows column definitions
to be altered.
* Initial support for building with Maven. It only builds jars for
JDBC 4/JDK 1.6, not for JDBC 3/JDK 1.5. Build with ant to build
JDBC 3/JDK 1.5 jars.
* Usernames for Migration#grant() and #revoke() are now converted
into the database's canonical case, e.g. lowercase or uppercase,
and then quoted.
* Refactor the unit tests to allow for testing with databases other
than Derby.
* The table names in the unit tests have been renamed to all start
with "scala_migrations_". This makes it easier to unit test the
project in an existing schema. The only table that doesn't start
with "scala_migrations_" is "schema_migrations".
* Lots of internal refactoring and code cleanup.
Version 1.0.0 - February 11th, 2010
* Provide Scala 2.8.0.Beta1 support. Code modifications that work
under both Scala 2.7.x and 2.8.x were applied to the default
(2.7.x) branch and merged to the scala-2.8 branch to minimize the
differences between the branches.
* Fix a bug in dropping indices in Oracle.
* Index names are now quoted and potentially case converted in the
same manner as column names.
* Provide a addingForeignKeyConstraintCreatesIndex method in
Migration and DatabaseAdaper that returns true if the database
implicitly adds an index on the column that has a foreign key
constraint added to it. This can be used to dynamically add an
index for those databases that don't implicitly add an index on
foreign key columns.
* Switch to using scaladoc instead of vscaladoc when compiling with
Scala 2.7.x to be consistent with compilation with Scala 2.8.x.
* Update the test suite to run against Derby 10.5.3 instead of
10.5.1.1.
* Switch code style to be more compliant with standard Scala code,
specifically, remove the space before a : in type annotations.
Version 0.9.2 - November 2nd, 2009
* Build with Scala 2.7.7.
Version 0.9.1 - September 2nd, 2009
* Add the ability to add and drop columns in existing tables. The
new methods are addColumn() and removeColumn() in the Migration
class.
Version 0.9.0 - August 1st, 2009
* First public release.