-
Notifications
You must be signed in to change notification settings - Fork 215
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Enable contract listeners with multiple filters
Signed-off-by: Nicko Guyer <[email protected]>
- Loading branch information
Showing
16 changed files
with
1,463 additions
and
341 deletions.
There are no files selected for viewing
3 changes: 3 additions & 0 deletions
3
db/migrations/postgres/000116_update_contractlisteners_add_events_column.down.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,3 @@ | ||
BEGIN; | ||
ALTER TABLE contractlisteners DROP COLUMN filters; | ||
COMMIT; |
5 changes: 5 additions & 0 deletions
5
db/migrations/postgres/000116_update_contractlisteners_add_events_column.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,5 @@ | ||
BEGIN; | ||
ALTER TABLE contractlisteners ADD COLUMN filters TEXT; | ||
ALTER TABLE contractlisteners ALTER COLUMN event DROP NOT NULL; | ||
ALTER TABLE contractlisteners ALTER COLUMN location DROP NOT NULL; | ||
COMMIT: |
1 change: 1 addition & 0 deletions
1
db/migrations/sqlite/000116_update_contractlisteners_add_events_column.down.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 @@ | ||
ALTER TABLE contractlisteners DROP COLUMN filters; |
12 changes: 12 additions & 0 deletions
12
db/migrations/sqlite/000116_update_contractlisteners_add_events_column.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,12 @@ | ||
ALTER TABLE contractlisteners ADD COLUMN filters TEXT; | ||
|
||
-- SQLite doesn't support dropping NOT NULL constraints so we have to move | ||
-- everything to a temp colum, create a new column, then copy the data back | ||
ALTER TABLE contractlisteners RENAME COLUMN event TO event_tmp; | ||
ALTER TABLE contractlisteners RENAME COLUMN location TO location_tmp; | ||
ALTER TABLE contractlisteners ADD COLUMN event TEXT; | ||
ALTER TABLE contractlisteners ADD LOCATION event TEXT; | ||
UPDATE contractlisteners SET event = event_tmp; | ||
UPDATE contractlisteners SET location = location_tmp; | ||
ALTER TABLE contractlisteners DROP COLUMN event_tmp; | ||
ALTER TABLE contractlisteners DROP COLUMN location_tmp; |
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
Large diffs are not rendered by default.
Oops, something went wrong.
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.