Skip to content

Commit 1279b7d

Browse files
Small docs change to thecreate_constraint operation (#488)
Better explain the `up` and `down` fields in the `create_constraint` operation.
1 parent 9c9518b commit 1279b7d

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

docs/README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1159,7 +1159,7 @@ Required fields: `name`, `table`, `type`, `up`, `down`.
11591159
"create_constraint": {
11601160
"table": "name of table",
11611161
"name": "my_unique_constraint",
1162-
"columns": ["col1", "col2"],
1162+
"columns": ["column1", "column2"],
11631163
"type": "unique"| "check" | "foreign_key",
11641164
"check": "SQL expression for CHECK constraint",
11651165
"references": {
@@ -1169,12 +1169,12 @@ Required fields: `name`, `table`, `type`, `up`, `down`.
11691169
"on_delete": "ON DELETE behaviour, can be CASCADE, SET NULL, RESTRICT, or NO ACTION. Default is NO ACTION",
11701170
},
11711171
"up": {
1172-
"col1": "col1 || random()",
1173-
"col2": "col2 || random()"
1172+
"column1": "up SQL expressions for each column covered by the constraint",
1173+
...
11741174
},
11751175
"down": {
1176-
"col1": "col1",
1177-
"col2": "col2"
1176+
"column1": "up SQL expressions for each column covered by the constraint",
1177+
...
11781178
}
11791179
}
11801180
}

0 commit comments

Comments
 (0)