Permalink
Browse files

Move migration scripts to carbon-5 default (src/main/resources/db)

--HG--
rename : petstore-infrastructure/src/main/scripts/migrations/20100218205002_create_products.sql => petstore-infrastructure/src/main/resources/db/migrations/20100218205002_create_products.sql
rename : petstore-infrastructure/src/main/scripts/migrations/20100226153955_add_product_description.sql => petstore-infrastructure/src/main/resources/db/migrations/20100226153955_add_product_description.sql
rename : petstore-infrastructure/src/main/scripts/migrations/20100226211757_add_product_photo.sql => petstore-infrastructure/src/main/resources/db/migrations/20100226211757_add_product_photo.sql
rename : petstore-infrastructure/src/main/scripts/migrations/20100304220628_add_product_number.sql => petstore-infrastructure/src/main/resources/db/migrations/20100304220628_add_product_number.sql
rename : petstore-infrastructure/src/main/scripts/migrations/20100305191346_create_items.sql => petstore-infrastructure/src/main/resources/db/migrations/20100305191346_create_items.sql
rename : petstore-infrastructure/src/main/scripts/migrations/20100315155917_add_item_description_and_item_price.sql => petstore-infrastructure/src/main/resources/db/migrations/20100315155917_add_item_description_and_item_price.sql
rename : petstore-infrastructure/src/main/scripts/migrations/20100408021904_create_order_number_sequence.sql => petstore-infrastructure/src/main/resources/db/migrations/20100408021904_create_order_number_sequence.sql
rename : petstore-infrastructure/src/main/scripts/migrations/20100408135825_create_orders_and_line_items.sql => petstore-infrastructure/src/main/resources/db/migrations/20100408135825_create_orders_and_line_items.sql
rename : petstore-infrastructure/src/main/scripts/migrations/20100408181318_add_billing_to_orders.sql => petstore-infrastructure/src/main/resources/db/migrations/20100408181318_add_billing_to_orders.sql
rename : petstore-infrastructure/src/main/scripts/migrations/20100408202400_rename_item_reference_number_to_number.sql => petstore-infrastructure/src/main/resources/db/migrations/20100408202400_rename_item_reference_number_to_number.sql
rename : petstore-infrastructure/src/main/scripts/migrations/20100413015512_add_description_and_unit_price_to_line_item.sql => petstore-infrastructure/src/main/resources/db/migrations/20100413015512_add_description_and_unit_price_to_line_item.sql
rename : petstore-infrastructure/src/main/scripts/migrations/20100413024430_add_order_line_to_line_item.sql => petstore-infrastructure/src/main/resources/db/migrations/20100413024430_add_order_line_to_line_item.sql
rename : petstore-infrastructure/src/main/scripts/migrations/20100414164731_create_payment_methods.sql => petstore-infrastructure/src/main/resources/db/migrations/20100414164731_create_payment_methods.sql
rename : petstore-infrastructure/src/main/scripts/migrations/20100414184750_add_payment_type_to_payments.sql => petstore-infrastructure/src/main/resources/db/migrations/20100414184750_add_payment_type_to_payments.sql
rename : petstore-infrastructure/src/main/scripts/migrations/20100825140227_make_order_number_unique.sql => petstore-infrastructure/src/main/resources/db/migrations/20100825140227_make_order_number_unique.sql
  • Loading branch information...
1 parent 1306867 commit be089adb5308e7389949a0bd33728343b6322c3b @testinfected committed Sep 1, 2012
Showing with 10 additions and 30 deletions.
  1. +1 −1 petstore-infrastructure/pom.xml
  2. 0 ...re-infrastructure/src/main/{scripts → resources/db}/migrations/20100218205002_create_products.sql
  3. 0 ...structure/src/main/{scripts → resources/db}/migrations/20100226153955_add_product_description.sql
  4. 0 ...-infrastructure/src/main/{scripts → resources/db}/migrations/20100226211757_add_product_photo.sql
  5. 0 ...infrastructure/src/main/{scripts → resources/db}/migrations/20100304220628_add_product_number.sql
  6. 0 petstore-infrastructure/src/main/{scripts → resources/db}/migrations/20100305191346_create_items.sql
  7. 0 ...c/main/{scripts → resources/db}/migrations/20100315155917_add_item_description_and_item_price.sql
  8. 0 ...ture/src/main/{scripts → resources/db}/migrations/20100408021904_create_order_number_sequence.sql
  9. 0 ...ture/src/main/{scripts → resources/db}/migrations/20100408135825_create_orders_and_line_items.sql
  10. 0 ...rastructure/src/main/{scripts → resources/db}/migrations/20100408181318_add_billing_to_orders.sql
  11. 0 ...ain/{scripts → resources/db}/migrations/20100408202400_rename_item_reference_number_to_number.sql
  12. 0 ...scripts → resources/db}/migrations/20100413015512_add_description_and_unit_price_to_line_item.sql
  13. 0 ...cture/src/main/{scripts → resources/db}/migrations/20100413024430_add_order_line_to_line_item.sql
  14. 0 ...astructure/src/main/{scripts → resources/db}/migrations/20100414164731_create_payment_methods.sql
  15. 0 ...ture/src/main/{scripts → resources/db}/migrations/20100414184750_add_payment_type_to_payments.sql
  16. 0 ...tructure/src/main/{scripts → resources/db}/migrations/20100825140227_make_order_number_unique.sql
  17. +5 −5 petstore-infrastructure/src/test/java/test/support/com/pyxis/petstore/db/DatabaseMigrator.java
  18. +0 −18 petstore-infrastructure/src/test/java/test/support/com/pyxis/petstore/db/MigrationProperties.java
  19. +3 −3 petstore-infrastructure/src/test/java/test/support/com/pyxis/petstore/db/TestEnvironment.java
  20. +0 −2 petstore-infrastructure/src/test/resources/integration/test.properties
  21. +1 −1 petstore-system-tests/pom.xml
View
2 petstore-infrastructure/pom.xml
@@ -119,7 +119,7 @@
<url>${jdbc.url}</url>
<username>${jdbc.username}</username>
<password>${jdbc.password}</password>
- <migrationsPath>${project.basedir}/src/main/scripts/migrations</migrationsPath>
+ <migrationsPath>${project.basedir}/src/main/resources/db/migrations</migrationsPath>
</configuration>
<dependencies>
<dependency>
View
0 ...ations/20100218205002_create_products.sql → ...ations/20100218205002_create_products.sql
File renamed without changes.
View
0 ...0100226153955_add_product_description.sql → ...0100226153955_add_product_description.sql
File renamed without changes.
View
0 ...ions/20100226211757_add_product_photo.sql → ...ions/20100226211757_add_product_photo.sql
File renamed without changes.
View
0 ...ons/20100304220628_add_product_number.sql → ...ons/20100304220628_add_product_number.sql
File renamed without changes.
View
0 ...igrations/20100305191346_create_items.sql → ...igrations/20100305191346_create_items.sql
File renamed without changes.
View
0 ...7_add_item_description_and_item_price.sql → ...7_add_item_description_and_item_price.sql
File renamed without changes.
View
0 ...08021904_create_order_number_sequence.sql → ...08021904_create_order_number_sequence.sql
File renamed without changes.
View
0 ...08135825_create_orders_and_line_items.sql → ...08135825_create_orders_and_line_items.sql
File renamed without changes.
View
0 .../20100408181318_add_billing_to_orders.sql → .../20100408181318_add_billing_to_orders.sql
File renamed without changes.
View
0 ...ename_item_reference_number_to_number.sql → ...ename_item_reference_number_to_number.sql
File renamed without changes.
View
0 ...scription_and_unit_price_to_line_item.sql → ...scription_and_unit_price_to_line_item.sql
File renamed without changes.
View
0 ...413024430_add_order_line_to_line_item.sql → ...413024430_add_order_line_to_line_item.sql
File renamed without changes.
View
0 ...20100414164731_create_payment_methods.sql → ...20100414164731_create_payment_methods.sql
File renamed without changes.
View
0 ...14184750_add_payment_type_to_payments.sql → ...14184750_add_payment_type_to_payments.sql
File renamed without changes.
View
0 ...100825140227_make_order_number_unique.sql → ...100825140227_make_order_number_unique.sql
File renamed without changes.
View
10 ...ore-infrastructure/src/test/java/test/support/com/pyxis/petstore/db/DatabaseMigrator.java
@@ -8,15 +8,15 @@
public class DatabaseMigrator {
- private final MigrationProperties properties;
+ private final DataSource dataSource;
- public DatabaseMigrator(Properties properties) {
- this.properties = new MigrationProperties(properties);
+ public DatabaseMigrator(DataSource dataSource) {
+ this.dataSource = dataSource;
}
- public void migrate(DataSource dataSource) {
+ public void migrate() {
DataSourceMigrationManager migrationManager = new DataSourceMigrationManager(dataSource);
- migrationManager.setMigrationResolver(new ResourceMigrationResolver(properties.migrationsPath()));
+ migrationManager.setMigrationResolver(new ResourceMigrationResolver());
migrationManager.migrate();
}
}
View
18 ...-infrastructure/src/test/java/test/support/com/pyxis/petstore/db/MigrationProperties.java
@@ -1,18 +0,0 @@
-package test.support.com.pyxis.petstore.db;
-
-import java.util.Properties;
-
-public class MigrationProperties {
-
- public static final String MIGRATIONS_PATH = "migrations.path";
-
- private final Properties properties;
-
- public MigrationProperties(Properties properties) {
- this.properties = properties;
- }
-
- public String migrationsPath() {
- return properties.getProperty(MIGRATIONS_PATH);
- }
-}
View
6 ...tore-infrastructure/src/test/java/test/support/com/pyxis/petstore/db/TestEnvironment.java
@@ -24,15 +24,15 @@ public static TestEnvironment load(final String name) {
public TestEnvironment(Properties properties) {
loadSpringContext(properties);
- migrateDatabase(properties);
+ migrateDatabase();
}
private void loadSpringContext(Properties properties) {
this.spring = new Spring(properties);
}
- private void migrateDatabase(Properties properties) {
- new DatabaseMigrator(properties).migrate(spring.getDataSource());
+ private void migrateDatabase() {
+ new DatabaseMigrator(spring.getDataSource()).migrate();
}
public <T> T get(Class<T> type) {
View
2 petstore-infrastructure/src/test/resources/integration/test.properties
@@ -3,5 +3,3 @@ jdbc.url: ${test.jdbc.url}
jdbc.username: ${test.jdbc.username}
jdbc.password: ${test.jdbc.password}
hibernate.dialect: ${test.hibernate.dialect}
-
-migrations.path = ${project.basedir}/src/main/scripts/migrations
View
2 petstore-system-tests/pom.xml
@@ -235,7 +235,7 @@
<url>${test.jdbc.url}</url>
<username>${test.jdbc.username}</username>
<password>${test.jdbc.password}</password>
- <migrationsPath>${project.basedir}/../petstore-infrastructure/src/main/scripts/migrations</migrationsPath>
+ <migrationsPath>${project.basedir}/../petstore-infrastructure/src/main/resources/db/migrations</migrationsPath>
</configuration>
<dependencies>
<dependency>

0 comments on commit be089ad

Please sign in to comment.