pgroll/examples/03_add_column.json
Andrew Farries dce42da85a
Support adding columns with UNIQUE, NOT NULL and DEFAULT constraints (#30)
Allow the **add column** operation to add columns with `NOT NULL`,
`UNIQUE` and `DEFAULT` constraints by re-using the SQL generation code
that adds columns to tables.
2023-07-13 08:38:43 +01:00

27 lines
470 B
JSON

{
"name": "03_add_column_to_products",
"operations": [
{
"add_column": {
"table": "products",
"column": {
"name": "description",
"type": "varchar(255)",
"nullable": true
}
}
},
{
"add_column": {
"table": "products",
"column": {
"name": "stock",
"type": "int",
"nullable": false,
"default": "100"
}
}
}
]
}