Redgate Flyway

For PostgreSQL users - where are your DBs hosted?

Tutorial - Baseline static data for new projects

EDITION: TEAMS

  1. Create a new project.
  2. On the Schema model tab, setup your development database.
  3. Click Manage Static Data and configure your static data as described above.  For the baseline, only specify static data that is already deployed to your downstream environments.
    1. If development has additional data that has moved on from what's been deployed, you may want to edit the Data\Table.sql file in your project to remove these rows.  (Or, you can just remove the extra records when you generate the the baseline script)
  4. Save your initial object schema and static data to disk.
  5. On the Generate migrations tab, setup your shadow database and create your baseline.  Since you're static data has already been configured and saved to the schema-model on disk, this will be picked up in the baseline script.

  6. After saving your generated baseline script, click Verify to execute it against the shadow database.
  7. Now is a good point to use the Version control tab to Commit and Push your baseline script to the repository so it's saved and other team members can start working on the project.  
  8. You can now start generating migrations for any changes to objects and static data going forward that will need to be deployed.
  1. Create a new project.
  2. On the Schema model tab, setup your development database.
  3. Configure static data by adding tables to track to the toml config file as follows

    1. [[redgateCompare.staticDataTables]]
    2. schema = "dbo"
    3. table = "Table_1"
    4.  
    5. [[redgateCompare.staticDataTables]]
    6. schema = "dbo"
    7. table = "Table_2"
    8. excludedColumns = [ "col2" ]
  4. Save your initial object schema and static data to disk.
  5. On the Generate migrations tab, setup your shadow database and create your baseline.  Since you're static data has already been configured and saved to the schema-model on disk, this will be picked up in the baseline script.

  6. Validate that the baseline script deploys against a clean database
  7. Now is a good point to Commit and Push your baseline script to the repository so it's saved and other team members can start working on the project.  
  8. You can now start generating migrations for any changes to objects and static data going forward that will need to be deployed.



Didn't find what you were looking for?