You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Allow adding a column to a table created in the same migration (#449)
Allow the `add_column` operation to add a column to a table that was
created by an operation earlier in the same migration.
The following migration would previously have failed to start:
```json
{
"name": "43_multiple_ops",
"operations": [
{
"create_table": {
"name": "players",
"columns": [
{
"name": "id",
"type": "serial",
"pk": true
},
{
"name": "name",
"type": "varchar(255)",
"check": {
"name": "name_length_check",
"constraint": "length(name) > 2"
}
}
]
}
},
{
"add_column": {
"table": "players",
"column": {
"name": "rating",
"type": "integer",
"comment": "hello world",
"check": {
"name": "rating_check",
"constraint": "rating > 0 AND rating < 100"
},
"nullable": false
}
}
}
]
}
```
As of this PR, the migration can be started.
The above migration does not validate yet, but it can be started
successfully with the `--skip-validation` flag to the `start` command.
Part of #239
0 commit comments