Skip to content

chore: added config sql script #5681

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions scripts/sql/275_policy_criteria_table.down.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
DROP TABLE IF EXISTS resource_qualifier_mapping_criteria CASCADE;

DELETE from devtron_resource_searchable_key ds where ds."name" in ('GLOBAL_ID', 'BASE_DEPLOYMENT_TEMPLATE');
20 changes: 20 additions & 0 deletions scripts/sql/275_policy_criteria_table.up.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
CREATE SEQUENCE IF NOT EXISTS id_seq_resource_qualifier_mapping_criteria;

CREATE TABLE IF NOT EXISTS resource_qualifier_mapping_criteria
(
"id" integer NOT NULL DEFAULT nextval('id_seq_resource_qualifier_mapping_criteria'::regclass),
"description" varchar(100),
"json_data" text,
"active" bool,
"created_on" timestamptz NOT NULL,
"created_by" int4 NOT NULL,
"updated_on" timestamptz NOT NULL,
"updated_by" int4 NOT NULL,
PRIMARY KEY ("id")
);

INSERT INTO devtron_resource_searchable_key(name, is_removed, created_on, created_by, updated_on, updated_by)
VALUES ('BASE_DEPLOYMENT_TEMPLATE', false, now(), 1, now(), 1);

INSERT INTO devtron_resource_searchable_key(name, is_removed, created_on, created_by, updated_on, updated_by)
VALUES ('GLOBAL_ID', false, now(), 1, now(), 1);