Skip to content

Commit

Permalink
Adding commands to alter cde tables (#2085)
Browse files Browse the repository at this point in the history
  • Loading branch information
dhruv-harness authored and Harness committed Jun 10, 2024
1 parent 42d03a8 commit 26760cd
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 6 deletions.
Original file line number Diff line number Diff line change
@@ -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;
10 changes: 4 additions & 6 deletions app/store/database/migrate/sqlite/0052_create_cde_tables.up.sql
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
);

0 comments on commit 26760cd

Please sign in to comment.