From 79e2328f49ac2e10189e6bd241738a4e9614a7cc Mon Sep 17 00:00:00 2001 From: ashish sonam Date: Tue, 14 May 2024 12:24:13 +0530 Subject: [PATCH] migration update for remote connection config --- .../sql/245_remote_connection_config.down.sql | 3 ++ .../sql/245_remote_connection_config.up.sql | 32 +++++++++++++++++++ 2 files changed, 35 insertions(+) create mode 100644 scripts/sql/245_remote_connection_config.down.sql create mode 100644 scripts/sql/245_remote_connection_config.up.sql diff --git a/scripts/sql/245_remote_connection_config.down.sql b/scripts/sql/245_remote_connection_config.down.sql new file mode 100644 index 0000000000..d7ba21b957 --- /dev/null +++ b/scripts/sql/245_remote_connection_config.down.sql @@ -0,0 +1,3 @@ +DROP TABLE remote_connection_config; +ALTER TABLE cluster DROP COLUMN remote_connection_config_id; +ALTER TABLE docker_artifact_store DROP COLUMN remote_connection_config_id; \ No newline at end of file diff --git a/scripts/sql/245_remote_connection_config.up.sql b/scripts/sql/245_remote_connection_config.up.sql new file mode 100644 index 0000000000..3bd9b7c958 --- /dev/null +++ b/scripts/sql/245_remote_connection_config.up.sql @@ -0,0 +1,32 @@ +ALTER TABLE cluster ADD COLUMN remote_connection_config_id INT; +ALTER TABLE docker_artifact_store ADD COLUMN remote_connection_config_id INT; + +CREATE SEQUENCE IF NOT EXISTS id_seq_remote_connection_config; +CREATE TABLE IF NOT EXISTS public.remote_connection_config +( + "id" int NOT NULL DEFAULT nextval('id_seq_remote_connection_config'::regclass), + "connection_method" + VARCHAR(50) NOT NULL, + "proxy_url" VARCHAR(300) , + "ssh_server_address" VARCHAR(300), + "ssh_username" VARCHAR(300), + "ssh_password" text, + "ssh_auth_key" text, + "deleted" bool NOT NULL, + "created_on" timestamptz NOT NULL, + "created_by" int4 NOT NULL, + "updated_on" timestamptz NOT NULL, + "updated_by" int4 NOT NULL, + PRIMARY KEY ("id") +); + +ALTER TABLE cluster + ADD CONSTRAINT fk_cluster_remote_connection_config + FOREIGN KEY (remote_connection_config_id) + REFERENCES remote_connection_config (id); + +ALTER TABLE docker_artifact_store + ADD CONSTRAINT fk_docker_artifact_store_remote_connection_config + FOREIGN KEY (remote_connection_config_id) + REFERENCES remote_connection_config (id); +