Skip to content

Commit 1c7a4f6

Browse files
authored
Merge pull request #6208 from devtron-labs/mandatory-tag
misc: migration for mandatory tag
2 parents 6820563 + 2f9394e commit 1c7a4f6

File tree

2 files changed

+26
-0
lines changed

2 files changed

+26
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
BEGIN;
2+
3+
-- Revert column type change
4+
ALTER TABLE global_tag
5+
ALTER COLUMN mandatory_project_ids_csv TYPE VARCHAR(100)
6+
USING mandatory_project_ids_csv::VARCHAR(100);
7+
8+
-- Drop columns deployment_policy and value_constraint_id
9+
ALTER TABLE global_tag
10+
DROP COLUMN IF EXISTS deployment_policy,
11+
DROP COLUMN IF EXISTS value_constraint_id;
12+
13+
COMMIT;
+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
BEGIN;
2+
3+
-- Alter Table: global_tag; Add columns deployment_policy and value_constraint_id
4+
ALTER TABLE global_tag
5+
ADD COLUMN IF NOT EXISTS deployment_policy VARCHAR(50) DEFAULT 'allow' NOT NULL,
6+
ADD COLUMN IF NOT EXISTS value_constraint_id INT;
7+
8+
-- Change column type to TEXT if it is not already TEXT
9+
ALTER TABLE global_tag
10+
ALTER COLUMN mandatory_project_ids_csv TYPE TEXT
11+
USING mandatory_project_ids_csv::TEXT;
12+
13+
COMMIT;

0 commit comments

Comments
 (0)