mirror of
https://github.com/xataio/pgroll.git
synced 2024-09-11 05:45:48 +03:00
Realated Issue: #132 This PR includes **BREAKING CHANGES**, existing migrations that add a not null constraint using the `not_null` property will not work anymore. The migration strategy would be to rename those `not_null` fields in `alter_column` operations to `nullable`.
15 lines
301 B
JSON
15 lines
301 B
JSON
{
|
|
"name": "16_set_nullable",
|
|
"operations": [
|
|
{
|
|
"alter_column": {
|
|
"table": "reviews",
|
|
"column": "review",
|
|
"nullable": false,
|
|
"up": "(SELECT CASE WHEN review IS NULL THEN product || ' is good' ELSE review END)",
|
|
"down": "review"
|
|
}
|
|
}
|
|
]
|
|
}
|