-
Notifications
You must be signed in to change notification settings - Fork 74
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
51 additions
and
39 deletions.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,42 +1,50 @@ | ||
BEGIN; | ||
|
||
ALTER TABLE data_stores ALTER COLUMN tenant_id TYPE varchar; | ||
|
||
UPDATE data_stores | ||
SET tenant_id = '00000000-0000-0000-0000-000000000000' | ||
SET tenant_id = '' | ||
WHERE tenant_id is null; | ||
|
||
ALTER TABLE data_stores | ||
DROP CONSTRAINT data_stores_pkey, | ||
ADD PRIMARY KEY (id, tenant_id), | ||
ALTER COLUMN tenant_id SET DEFAULT '00000000-0000-0000-0000-000000000000'; | ||
ALTER COLUMN tenant_id SET DEFAULT ''; | ||
|
||
|
||
ALTER TABLE polling_profiles ALTER COLUMN tenant_id TYPE varchar; | ||
|
||
UPDATE polling_profiles | ||
SET tenant_id = '00000000-0000-0000-0000-000000000000' | ||
SET tenant_id = '' | ||
WHERE tenant_id is null; | ||
|
||
ALTER TABLE polling_profiles | ||
DROP CONSTRAINT polling_profiles_pkey, | ||
ADD PRIMARY KEY (id, tenant_id), | ||
ALTER COLUMN tenant_id SET DEFAULT '00000000-0000-0000-0000-000000000000'; | ||
ALTER COLUMN tenant_id SET DEFAULT ''; | ||
|
||
|
||
ALTER TABLE linters ALTER COLUMN tenant_id TYPE varchar; | ||
|
||
UPDATE linters | ||
SET tenant_id = '00000000-0000-0000-0000-000000000000' | ||
SET tenant_id = '' | ||
WHERE tenant_id is null; | ||
|
||
ALTER TABLE linters | ||
DROP CONSTRAINT linters_pkey, | ||
ADD PRIMARY KEY (id, tenant_id), | ||
ALTER COLUMN tenant_id SET DEFAULT '00000000-0000-0000-0000-000000000000'; | ||
ALTER COLUMN tenant_id SET DEFAULT ''; | ||
|
||
|
||
ALTER TABLE test_runners ALTER COLUMN tenant_id TYPE varchar; | ||
|
||
UPDATE test_runners | ||
SET tenant_id = '00000000-0000-0000-0000-000000000000' | ||
SET tenant_id = '' | ||
WHERE tenant_id is null; | ||
|
||
ALTER TABLE test_runners | ||
DROP CONSTRAINT test_runners_pkey, | ||
ADD PRIMARY KEY (id, tenant_id), | ||
ALTER COLUMN tenant_id SET DEFAULT '00000000-0000-0000-0000-000000000000'; | ||
ALTER COLUMN tenant_id SET DEFAULT ''; | ||
|
||
COMMIT; |
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