-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(cd-service): add applications column to the environments table, f…
…ix DeleteEnvFromApp (#1983) Ref: SRX-GJNPF1
- Loading branch information
Showing
9 changed files
with
246 additions
and
38 deletions.
There are no files selected for viewing
6 changes: 6 additions & 0 deletions
6
database/migrations/postgres/1727264269691278_environments_applications.up.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
DO $$ | ||
BEGIN | ||
IF NOT EXISTS (SELECT 1 FROM information_schema.columns WHERE table_name = 'environments' AND column_name='applications') THEN | ||
ALTER TABLE IF EXISTS environments ADD COLUMN applications VARCHAR; | ||
END IF; | ||
END $$; |
16 changes: 16 additions & 0 deletions
16
database/migrations/sqlite/1727264269691278_environments_applications.up.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
CREATE TABLE IF NOT EXISTS environments_new | ||
( | ||
created TIMESTAMP, | ||
version BIGINT, | ||
name VARCHAR(255), | ||
json VARCHAR, | ||
applications VARCHAR, | ||
PRIMARY KEY(name, version) | ||
); | ||
|
||
INSERT INTO environments_new(created, version, name, json) | ||
SELECT created, version, name, json | ||
FROM environments; | ||
|
||
DROP TABLE IF EXISTS environments; | ||
ALTER TABLE environments_new RENAME TO environments; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.