-
Notifications
You must be signed in to change notification settings - Fork 73
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Alexis Rico <[email protected]>
- Loading branch information
Showing
5 changed files
with
26 additions
and
62 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 was deleted.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
# Drop column | ||
|
||
## Structure | ||
|
||
A drop column operation drops a column from an existing table. | ||
|
||
```json | ||
{ | ||
"drop_column": { | ||
"table": "name of table", | ||
"column": "name of column to drop", | ||
"down": "SQL expression" | ||
} | ||
} | ||
``` | ||
|
||
The `down` field above is required in order to backfill the previous version of the schema during an active migration. | ||
|
||
## Examples | ||
|
||
### Drop a column with a default value | ||
|
||
If a new row is inserted against the new schema without a `price` column, the old schema `price` column will be set to `0`. | ||
|
||
<ExampleSnippet example="09_drop_column.json" /> |