pgroll/examples/12_create_employees_table.json
Andrew Farries 6448afe956
Implement 'rename column' migrations (#52)
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.
2023-08-18 06:49:27 +01:00

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)"
}
]
}
}
]
}