diff --git a/database_admin/migrations/127_template_arch_version.down.sql b/database_admin/migrations/127_template_arch_version.down.sql new file mode 100644 index 000000000..291d5e6cf --- /dev/null +++ b/database_admin/migrations/127_template_arch_version.down.sql @@ -0,0 +1,2 @@ +ALTER TABLE template DROP COLUMN IF EXISTS version; +ALTER TABLE template DROP COLUMN IF EXISTS arch; diff --git a/database_admin/migrations/127_template_arch_version.up.sql b/database_admin/migrations/127_template_arch_version.up.sql new file mode 100644 index 000000000..61c246bdf --- /dev/null +++ b/database_admin/migrations/127_template_arch_version.up.sql @@ -0,0 +1,2 @@ +ALTER TABLE template ADD COLUMN IF NOT EXISTS arch TEXT CHECK (NOT empty(arch)); +ALTER TABLE template ADD COLUMN IF NOT EXISTS version TEXT CHECK (NOT empty(version)); diff --git a/database_admin/schema/create_schema.sql b/database_admin/schema/create_schema.sql index 5616553ee..a5df1d5dc 100644 --- a/database_admin/schema/create_schema.sql +++ b/database_admin/schema/create_schema.sql @@ -7,7 +7,7 @@ CREATE TABLE IF NOT EXISTS schema_migrations INSERT INTO schema_migrations -VALUES (126, false); +VALUES (127, false); -- --------------------------------------------------------------------------- -- Functions @@ -693,6 +693,8 @@ CREATE TABLE IF NOT EXISTS template published TIMESTAMP WITH TIME ZONE, last_edited TIMESTAMP WITH TIME ZONE, environment_id TEXT NOT NULL CHECK (not empty(environment_id)), + arch TEXT CHECK (not empty(arch)), + version TEXT CHECK (not empty(version)), PRIMARY KEY (rh_account_id, id), UNIQUE(rh_account_id, uuid) ) PARTITION BY HASH (rh_account_id);