Skip to content

Commit

Permalink
RHINENG-10240: add template arch,version columns
Browse files Browse the repository at this point in the history
  • Loading branch information
psegedy committed Jun 12, 2024
1 parent 30a9ef6 commit 7f453d7
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
2 changes: 2 additions & 0 deletions database_admin/migrations/127_template_arch_version.down.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
ALTER TABLE template DROP COLUMN IF EXISTS version;
ALTER TABLE template DROP COLUMN IF EXISTS arch;
2 changes: 2 additions & 0 deletions database_admin/migrations/127_template_arch_version.up.sql
Original file line number Diff line number Diff line change
@@ -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));
4 changes: 3 additions & 1 deletion database_admin/schema/create_schema.sql
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ CREATE TABLE IF NOT EXISTS schema_migrations


INSERT INTO schema_migrations
VALUES (126, false);
VALUES (127, false);

-- ---------------------------------------------------------------------------
-- Functions
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit 7f453d7

Please sign in to comment.