pgroll/examples/25_add_table_with_check_constraint.json
Andrew Farries 200529d5a3
Allow columns with CHECK constraints in create table operations (#108)
Allow columns with `CHECK` constraints in `create_table` operations:

```json
{
  "name": "25_add_table_with_check_constraint",
  "operations": [
    {
      "create_table": {
        "name": "people",
        "columns": [
          {
            "name": "id",
            "type": "integer",
            "pk": true
          },
          {
            "name": "name",
            "type": "varchar(255)",
            "check": {
              "name": "name_length",
              "constraint": "length(name) > 3"
            }
          }
        ]
      }
    }
  ]
}
```
2023-09-19 10:00:55 +00:00

26 lines
489 B
JSON

{
"name": "25_add_table_with_check_constraint",
"operations": [
{
"create_table": {
"name": "people",
"columns": [
{
"name": "id",
"type": "integer",
"pk": true
},
{
"name": "name",
"type": "varchar(255)",
"check": {
"name": "name_length",
"constraint": "length(name) > 3"
}
}
]
}
}
]
}