diff --git a/store/shared/migrate/mysql/ddl_gen.go b/store/shared/migrate/mysql/ddl_gen.go index 5e872fb5..2aee30d1 100644 --- a/store/shared/migrate/mysql/ddl_gen.go +++ b/store/shared/migrate/mysql/ddl_gen.go @@ -156,6 +156,10 @@ var migrations = []struct { name: "create-index-latest-repo", stmt: createIndexLatestRepo, }, + { + name: "create-table-template", + stmt: createTableTemplate, + }, } // Migrate performs the database migration. If the migration fails @@ -658,3 +662,18 @@ CREATE TABLE IF NOT EXISTS latest ( var createIndexLatestRepo = ` CREATE INDEX ix_latest_repo ON latest (latest_repo_id); ` + +// +// 015_create_table_template.sql +// + +var createTableTemplate = ` +CREATE TABLE IF NOT EXISTS template ( + template_id INTEGER PRIMARY KEY AUTO_INCREMENT + ,template_name VARCHAR(500) + ,template_data BLOB + ,template_created INTEGER + ,template_updated INTEGER + ,UNIQUE(template_name) + ); +` diff --git a/store/shared/migrate/postgres/ddl_gen.go b/store/shared/migrate/postgres/ddl_gen.go index ee5fe4e8..59d9e3fc 100644 --- a/store/shared/migrate/postgres/ddl_gen.go +++ b/store/shared/migrate/postgres/ddl_gen.go @@ -152,6 +152,10 @@ var migrations = []struct { name: "create-index-latest-repo", stmt: createIndexLatestRepo, }, + { + name: "create-table-template", + stmt: createTableTemplate, + }, } // Migrate performs the database migration. If the migration fails @@ -636,3 +640,17 @@ CREATE TABLE IF NOT EXISTS latest ( var createIndexLatestRepo = ` CREATE INDEX IF NOT EXISTS ix_latest_repo ON latest (latest_repo_id); ` + +// +// 016_create_template_table.sql +// + +var createTableTemplate = ` +CREATE TABLE IF NOT EXISTS template ( + template_id SERIAL PRIMARY KEY + ,template_name TEXT UNIQUE + ,template_data BYTEA + ,template_created INTEGER + ,template_updated INTEGER +); +` diff --git a/store/shared/migrate/sqlite/ddl_gen.go b/store/shared/migrate/sqlite/ddl_gen.go index be13f6d6..ab5ba6b5 100644 --- a/store/shared/migrate/sqlite/ddl_gen.go +++ b/store/shared/migrate/sqlite/ddl_gen.go @@ -152,6 +152,10 @@ var migrations = []struct { name: "create-index-latest-repo", stmt: createIndexLatestRepo, }, + { + name: "create-table-template", + stmt: createTableTemplate, + }, } // Migrate performs the database migration. If the migration fails @@ -638,3 +642,17 @@ CREATE TABLE IF NOT EXISTS latest ( var createIndexLatestRepo = ` CREATE INDEX IF NOT EXISTS ix_latest_repo ON latest (latest_repo_id); ` + +// +// 015_create_template_table.sql +// + +var createTableTemplate = ` +CREATE TABLE IF NOT EXISTS template ( + template_id INTEGER PRIMARY KEY AUTOINCREMENT + ,template_name TEXT UNIQUE + ,template_data BLOB + ,template_created INTEGER + ,template_updated INTEGER +); +`