This is a demonstration of how to build a database and fill it with data using Flyway, It takes as its example, Microsoft's sample database Adventureworks, and shows how to use flyway to build it entirely from BCP data files and a build script. It demonstrates how to use afterMigrate scripts with placeholders to to the more awkward work.
name | What it does |
---|---|
BuildAndFill.ps1 | This is the PowerShell script that drives the migration. The only real complication is in managing passwords for credentials so that they don't need to be stored in the script |
afterMigrate__Add_Version_EP.sql | This is borrowed from another project, and writes the flyway version to an extended property, and writes the build to the SQL Server log so it can be monitored |
afterMigrate__ReadEveryTableViaBCP.sql | This is executed after a migration and loads the appropriate version of the data using BCP |
V1.1.3__Adventureworks.conf | a file-level config file for Adventureworks that informs Flyway that it is a mixed build script that shouldn't be wrapped in a transaction because of freetext search.. |
V1.1.3__Adventureworks.sql | a build script for Adventureworks without a transaction, generated by SQL Compare. |
CreateAdWorksDatabase.sql | A simple utility script for cleaning out a database. Flyway's Clean command can't always do it |
SaveEveryTable.sql | A utility to save the data of a database in a series of UTF-8 native BCP files named after the schema and tables into the directory you specify. |