* The Nim binary now recognizes the following environment and allows them to override configured values: - `DATABASE_DRIVER`: overrides the `driver` config value, selects which kind of database we expect to connect to. - `MIGRATIONS_DIR`: overrides the `sqlDir` config value, sets the path to the directory containing the migration SQL files. - `DATABASE_URL`: overrides the `connectionString` config value, supplies connection parameters to the database. - `DBM_LOG_LEVEL`: overrides the `logLevel` config value, sets the logging level of db_migrate. * Fixes a bug in the parsing of migration files. Previously the file was split on `;` characters and chunks that started with `--` were ignored as comments. This was wrong in the common case where a block starts with a comment but then contains SQL further. Such a block was being ignored. The new behavior is to consider each line and build up queries that way. * Fixes a logging bug when parsing the configuration. If there was an that prevented the configuration from loading this in turn prevented logging from being setup correctly, and so the error was not logged. Now errors that may occur before logging is setup are hard-coded to be logged to STDERR. * Changes the logic for creating the `migrations` table to check before performing the query that creates the table. This is to avoid continually printing messages about skipping this creation when the table already exists (which is the normal case). This change is PostgreSQL-specific, but of course the entire tool is currently PostgreSQL-specific.
29 lines
648 B
Groovy
29 lines
648 B
Groovy
apply plugin: 'groovy'
|
|
apply plugin: 'application'
|
|
apply plugin: 'maven'
|
|
|
|
group = 'com.jdblabs'
|
|
version = '0.2.5'
|
|
|
|
mainClassName = 'com.jdblabs.dbmigrate.DbMigrate'
|
|
|
|
repositories {
|
|
mavenLocal()
|
|
mavenCentral()
|
|
maven { url "http://mvn.jdb-labs.com/repo" }
|
|
}
|
|
|
|
dependencies {
|
|
compile localGroovy()
|
|
compile 'ch.qos.logback:logback-classic:1.1.3'
|
|
compile 'ch.qos.logback:logback-core:1.1.3'
|
|
compile 'com.jdbernard:jdb-util:4.4'
|
|
compile 'com.offbytwo:docopt:0.6.0.20150202'
|
|
compile 'com.zaxxer:HikariCP:2.4.3'
|
|
|
|
testCompile 'junit:junit:4.12'
|
|
|
|
runtime 'com.h2database:h2:1.4.185'
|
|
runtime 'org.postgresql:postgresql:9.4.1207.jre7'
|
|
}
|