From 26760cdbd2e996af8cdb557794c4d5f561e0232f Mon Sep 17 00:00:00 2001 From: Dhruv Dhruv Date: Mon, 10 Jun 2024 13:27:21 +0000 Subject: [PATCH] Adding commands to alter cde tables (#2085) --- .../migrate/postgres/0053_alter_cde_tables.up.sql | 9 +++++++++ .../migrate/sqlite/0052_create_cde_tables.up.sql | 10 ++++------ 2 files changed, 13 insertions(+), 6 deletions(-) create mode 100644 app/store/database/migrate/postgres/0053_alter_cde_tables.up.sql diff --git a/app/store/database/migrate/postgres/0053_alter_cde_tables.up.sql b/app/store/database/migrate/postgres/0053_alter_cde_tables.up.sql new file mode 100644 index 000000000..5cc83f977 --- /dev/null +++ b/app/store/database/migrate/postgres/0053_alter_cde_tables.up.sql @@ -0,0 +1,9 @@ +ALTER TABLE gitspace_events RENAME COLUMN geven_state to geven_event; + +ALTER TABLE gitspace_events DROP COLUMN geven_space_id; + +ALTER TABLE gitspaces ADD COLUMN gits_access_key TEXT; + +ALTER TABLE gitspaces ADD COLUMN gits_access_type TEXT; + +ALTER TABLE gitspaces ADD COLUMN gits_machine_user TEXT; \ No newline at end of file diff --git a/app/store/database/migrate/sqlite/0052_create_cde_tables.up.sql b/app/store/database/migrate/sqlite/0052_create_cde_tables.up.sql index ba3555c71..d128c5ed5 100644 --- a/app/store/database/migrate/sqlite/0052_create_cde_tables.up.sql +++ b/app/store/database/migrate/sqlite/0052_create_cde_tables.up.sql @@ -144,6 +144,9 @@ CREATE TABLE gitspaces gits_total_time_used BIGINT NOT NULL, gits_infra_provisioned_id INTEGER, gits_tracked_changes TEXT, + gits_access_key TEXT, + gits_access_type TEXT, + gits_machine_user TEXT, UNIQUE (gits_gitspace_config_id, gits_space_id), CONSTRAINT fk_gits_gitspace_config_id FOREIGN KEY (gits_gitspace_config_id) REFERENCES gitspace_configs (gconf_id) MATCH SIMPLE @@ -163,15 +166,10 @@ CREATE TABLE gitspace_events ( geven_id INTEGER PRIMARY KEY AUTOINCREMENT, geven_gitspace_config_id INTEGER NOT NULL, - geven_state TEXT NOT NULL, + geven_event TEXT NOT NULL, geven_created BIGINT NOT NULL, - geven_space_id INTEGER NOT NULL, CONSTRAINT fk_geven_gitspace_config_id FOREIGN KEY (geven_gitspace_config_id) REFERENCES gitspace_configs (gconf_id) MATCH SIMPLE ON UPDATE NO ACTION - ON DELETE CASCADE, - CONSTRAINT fk_geven_space_id FOREIGN KEY (geven_space_id) - REFERENCES spaces (space_id) MATCH SIMPLE - ON UPDATE NO ACTION ON DELETE CASCADE ); \ No newline at end of file