Added seperate gradle tasks for migrating a list DB and a tenant DB. No need to now pass a folder name. Discussed with Vishwas, and modified the war task to pick up the migration files from the appropriate folder... core_db folder.

This commit is contained in:
Khushal Oza
2013-04-04 16:14:20 +05:30
parent 8956ef35a3
commit 4bda6f3d43
+28 -7
View File
@@ -195,7 +195,7 @@ task deployPentahoReports() {
war {
it.dependsOn deployPentahoReports
from ('../mifosng-db/migrations') {
from ('../mifosng-db/migrations/core_db') {
into "WEB-INF/classes/sql"
}
}
@@ -309,22 +309,43 @@ flyway {
}
task migrateDB<<{
description="Migrates the DB. Have to pass dbName and folder name where the .sql file are kept for that DB. (Example: -PdbName=someDBname -PmigrationScriptFolder=someFolderName). "
task migrateTenantDB<<{
description="Migrates a Tenant DB. Have to pass dbName. (Example: -PdbName=someTenantDBname). "
flyway.url= "jdbc:mysql://localhost:3306/$dbName"
flyway.locations= [
"filesystem:../mifosng-db/migrations/$migrationScriptFolder",
"filesystem:../mifosng-db/migrations/core_db",
]
flywayMigrate.execute()
}
task showDBInfo<<{
description="Shows the migration info for a DB. Have to pass dbName and folder name where the .sql file are kept for that DB. (Example: -PdbName=someDBname -PmigrationScriptFolder=someFolderName)"
task showTenantDBInfo<<{
description="Shows the migration info for a Tenant DB. Have to pass dbName. (Example: -PdbName=someTenantDBname)"
flyway.url= "jdbc:mysql://localhost:3306/$dbName"
flyway.locations= [
"filesystem:../mifosng-db/migrations/$migrationScriptFolder",
"filesystem:../mifosng-db/migrations/core_db",
]
flywayInfo.execute()
}
task migrateTenantListDB<<{
description="Migrates a Tenant List DB. Have to pass dbName. (Example: -PdbName=someDBname)"
flyway.url= "jdbc:mysql://localhost:3306/$dbName"
flyway.locations= [
"filesystem:../mifosng-db/migrations/list_db",
]
flywayMigrate.execute()
}
task showTenentListDBInfo<<{
description="Shows the migration info for a List DB. Have to pass dbName. (Example: -PdbName=someDBname)"
flyway.url= "jdbc:mysql://localhost:3306/$dbName"
flyway.locations= [
"filesystem:../mifosng-db/migrations/list_db",
]
flywayInfo.execute()
}