Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update schema during add column validation (#457)
Update the schema during `add_column` operation validation so that validation of subsequent operations in the same migration can see the new column. This means that migrations that add a new column and then perform some other operation, like adding an index, on that column can be validated because the new column is visible to the `create_index` operation during it's validation phase. This means that the following migration is now able to validate: ```json { "name": "43_multiple_ops", "operations": [ { "add_column": { "table": "players", "column": { "name": "rating", "type": "integer", "comment": "hello world", "check": { "name": "rating_check", "constraint": "rating > 0 AND rating < 100" }, "nullable": false } } }, { "create_index": { "name": "idx_player_rating", "table": "players", "columns": [ "rating" ] } } ] } ``` Previously, the new column would not have been visible to the `create_index` operation and its validation would have failed. This PR does for the `add_column` operation what #455 did for the `create_table` operation. Part of #239