This repository has been archived by the owner on Jan 17, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 128
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
- And the new 'abuse', 'usererror', and 'watchdog' block types. (#4347)
- Loading branch information
1 parent
17daa57
commit 513693e
Showing
6 changed files
with
51 additions
and
4 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
-- pg-patcher runs migrations in transactions. However, ALTER TYPE ... ADD VALUE | ||
-- cannot be executed inside a transaction block. We will swap out the enum type | ||
-- with a new one instead. | ||
ALTER TYPE shot_block_type RENAME TO old_shot_block_type; | ||
CREATE TYPE shot_block_type AS ENUM ('none', 'dmca', 'abuse', 'usererror', 'watchdog'); | ||
ALTER TABLE data ALTER COLUMN block_type DROP DEFAULT; | ||
ALTER TABLE data ALTER COLUMN block_type TYPE shot_block_type USING block_type::text::shot_block_type; | ||
ALTER TABLE data ALTER COLUMN block_type SET DEFAULT 'none'::shot_block_type; | ||
DROP TYPE old_shot_block_type; |
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,4 @@ | ||
-- Records using the new enum values from 22-23 must be updated or deleted in | ||
-- order to update the enum type. Moreover, the entire `data` table must be | ||
-- updated to use a new enum type (see 22-23 for what's entailed). | ||
-- For those reasons, we refrain from removing the enum values in here. |
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,12 @@ | ||
CREATE TABLE watchdog_submissions ( | ||
id SERIAL, | ||
shot_id CHARACTER VARYING(270) NOT NULL, | ||
request_id CHARACTER(36) NOT NULL, | ||
nonce CHARACTER(36) NOT NULL, | ||
positive_result boolean, | ||
CONSTRAINT watchdog_pkey PRIMARY KEY (id), | ||
CONSTRAINT watchdog_shot_id_fkey FOREIGN KEY (shot_id) | ||
REFERENCES data(id) | ||
ON UPDATE NO ACTION | ||
ON DELETE CASCADE | ||
); |
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 @@ | ||
DROP TABLE watchdog_submissions; |
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