mirror of
https://github.com/xataio/pgroll.git
synced 2024-09-11 05:45:48 +03:00
Make it required to supply a name for a foreign key constraint created in either the `create_table`, `add_column` or `set_foreign_key` operations. It should be possible to drop constraints with a later migration (not yet implemented), so requiring a name and not relying on automatic generation of constraint names will make this easier. The same thing was done for indexes in #59 and `CHECK` constraints in #99.
31 lines
576 B
JSON
31 lines
576 B
JSON
{
|
|
"name": "19_create_orders_table",
|
|
"operations": [
|
|
{
|
|
"create_table": {
|
|
"name": "orders",
|
|
"columns": [
|
|
{
|
|
"name": "id",
|
|
"type": "serial",
|
|
"pk": true
|
|
},
|
|
{
|
|
"name": "user_id",
|
|
"type": "integer",
|
|
"references": {
|
|
"name": "fk_users_id",
|
|
"table": "users",
|
|
"column": "id"
|
|
}
|
|
},
|
|
{
|
|
"name": "quantity",
|
|
"type": "int"
|
|
}
|
|
]
|
|
}
|
|
}
|
|
]
|
|
}
|