I have baselined my existing database with a V1__Base_version.sql. Now, when I run migrate and have files like V2__Migration_842.sql and V3__Migration_842.sql, my V1__Base_version.sql gets executed again and fails with the following message :
PS: I rename the .sql files during my build appending a timeStamp to it so no 2 developers get the same file name after checking-in.
Migration 20170401092116374__V1__Base_version.sql failed -------------------------------------------------------- SQL State : 42P07 Error Code : 0 Message : ERROR: relation "address_space" already exists Location : /Users/code/main/migration/resources/sql/20170401092116374__V1__Base_version.sql (/Users/code/main/migration/resources/sql/20170401092116374__V1__Base_version.sql) Line : 33 Statement : CREATE TABLE address_space ( id character varying(32) NOT NULL, address_type character varying(255) NOT NULL, last_modified_timestamp timestamp without time zone ) }]
My baseline succeeds with the following message :
- Creating Metadata table: "public"."schema_version"
- Successfully baselined schema with version: 1
- Current version of schema "public": 1
- Migrating schema "public" to version 20170401092116374 - V1 Base version
Should not the migrate ignore the 20170401092116374__V1__Base_version.sql? I have set the BaselineOnMigrate and ValidateOnMigrate flags to false.
The 3 .sql file names after the build are as follows :
- 20170401092116374__V1__Base_version.sql
- 20170512102926635__V2__Migration_for_8_4_3.sql
- 20170531164538687__V3__Migration_843.sql
What is that I am missing here???
Thanks