Skip to content

Commit b9de978

Browse files
committedOct 15, 2019
Database migration initialization
This commit introduces a day 0 set of building blocks to implement a database migration framework into the sqlite database. Adding the following changes: - Introduce the `golang-migrate` project as a dependency and vendor it - Introduce a `db_migrations` folder with an initial no-op migration to bootstrap the initial database version for newly created databases - Update the initialization of the database when creating the initial schema to hard set the database migration version on db creation before loading any data This commit does not introduce a method of actually running future migrations against existing databases -- that is left for future implementation based on this groundwork when a set of commands that updates the database in place exists and requires the migration. The intention of this commit is also to ensure that future initialized registry databases have an initial version that can be used for migrations in future releases.
1 parent 2f3ee84 commit b9de978

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

88 files changed

+4913
-5909
lines changed
 

‎cmd/configmap-server/main.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ func runCmdFunc(cmd *cobra.Command, args []string) error {
9898
logger.Fatalf("error getting configmap: %s", err)
9999
}
100100

101-
sqlLoader, err := sqlite.NewSQLLiteLoader(dbName)
101+
sqlLoader, err := sqlite.NewSQLLiteLoader(dbName, "")
102102
if err != nil {
103103
return err
104104
}

‎cmd/initializer/main.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ func runCmdFunc(cmd *cobra.Command, args []string) error {
5353
return err
5454
}
5555

56-
dbLoader, err := sqlite.NewSQLLiteLoader(outFilename)
56+
dbLoader, err := sqlite.NewSQLLiteLoader(outFilename, "")
5757
if err != nil {
5858
return err
5959
}

0 commit comments

Comments
 (0)
Please sign in to comment.