mirror of
https://github.com/xataio/pgroll.git
synced 2024-09-11 13:55:28 +03:00
dce42da85a
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.
27 lines
470 B
JSON
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"
|
|
}
|
|
}
|
|
}
|
|
]
|
|
}
|