-
Notifications
You must be signed in to change notification settings - Fork 82
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
…280) This change updates the `sql` operation to: * Allow for a new `onComplete` flag, that will make it run on the Complete phase, rather than doing it during Start (default behavior). * Allows for `sql` operations next to others in the same migration. We added this limitation to ensure this operation doesn't affect others, especially around schema state management. Having `sql` next to other operations has proven convenient sometimes, by adding `onComplete` flag, we can allow for these migrations to run and rely on views recreation based on the final state. --------- Co-authored-by: Andrew Farries <[email protected]>
- Loading branch information
1 parent
889946b
commit 58fa7ae
Showing
11 changed files
with
244 additions
and
20 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
{ | ||
"name": "32_sql_on_complete", | ||
"operations": [ | ||
{ | ||
"sql": { | ||
"up": "ALTER TABLE people ADD COLUMN birth_date timestamp", | ||
"onComplete": true | ||
} | ||
} | ||
] | ||
} |
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,18 @@ | ||
This is a valid 'sql' migration. | ||
It specifies `up`, and `on_complete` | ||
|
||
-- create_table.json -- | ||
{ | ||
"name": "migration_name", | ||
"operations": [ | ||
{ | ||
"sql": { | ||
"up": "CREATE TABLE users (id INTEGER PRIMARY KEY, name TEXT)", | ||
"onComplete": true | ||
} | ||
} | ||
] | ||
} | ||
|
||
-- valid -- | ||
true |
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,19 @@ | ||
This is an invalid 'sql' migration. | ||
It specifies `up`, `down` and `on_complete` | ||
|
||
-- create_table.json -- | ||
{ | ||
"name": "migration_name", | ||
"operations": [ | ||
{ | ||
"sql": { | ||
"up": "CREATE TABLE users (id INTEGER PRIMARY KEY, name TEXT)", | ||
"down": "DROP TABLE users", | ||
"onComplete": true | ||
} | ||
} | ||
] | ||
} | ||
|
||
-- valid -- | ||
false |
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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