Alter column operations should support specifying fields that are unchanged as no-ops.
For example, this migration:
{
"name": "35_alter_column_multiple",
"operations": [
{
"alter_column": {
"table": "events",
"column": "name",
"name": "event_name",
"nullable": false,
"up": "(SELECT CASE WHEN name IS NULL THEN 'placeholder' ELSE name END)",
"down": "name"
}
}
]
}
Renames a field and sets it to NOT NULL. If the field is already NOT NULL, the operation should not perform any column duplication or backfilling to support setting the column nullability.
Alter column operations should support specifying fields that are unchanged as no-ops.
For example, this migration:
Renames a field and sets it to
NOT NULL
. If the field is alreadyNOT NULL
, the operation should not perform any column duplication or backfilling to support setting the column nullability.