mirror of
https://github.com/xataio/pgroll.git
synced 2024-10-06 01:57:32 +03:00
6448afe956
Add support for **rename column** migrations. A rename column migration looks like: ```json { "name": "13_rename_column", "operations": [ { "rename_column": { "table": "employees", "from": "role", "to": "jobTitle" } } ] } ``` * On `Start`, the view in the new version schema aliases the renamed column to its new name. The column in the underlying table is not renamed. * `Rollback` is a no-op. * `Complete` renames the column in the underlying table.
22 lines
360 B
JSON
22 lines
360 B
JSON
{
|
|
"name": "12_create_employees_table",
|
|
"operations": [
|
|
{
|
|
"create_table": {
|
|
"name": "employees",
|
|
"columns": [
|
|
{
|
|
"name": "id",
|
|
"type": "serial",
|
|
"pk": true
|
|
},
|
|
{
|
|
"name": "role",
|
|
"type": "varchar(255)"
|
|
}
|
|
]
|
|
}
|
|
}
|
|
]
|
|
}
|