Skip to content

Commit 213920b

Browse files
committed
Fix ALTER TABLE documentation
Copypasta typically tastes a bit funny. Signed-off-by: Stephen Celis <stephen@stephencelis.com>
1 parent 8a85d80 commit 213920b

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

Documentation/Index.md

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -965,11 +965,13 @@ The `alter` function shares several of the same [`column` function parameters](#
965965
- `collate` adds a `COLLATE` clause to `Expression<String>` (and `Expression<String?>`) column definitions with [a collating sequence](https://www.sqlite.org/datatype3.html#collation) defined in the `Collation` enumeration.
966966

967967
``` swift
968-
t.column(email, collate: .Nocase)
969-
// email TEXT NOT NULL COLLATE "NOCASE"
968+
t.alter(table: users, add: email, collate: .Nocase)
969+
// ALTER TABLE "users"
970+
// ADD COLUMN "email" TEXT NOT NULL COLLATE "NOCASE"
970971

971-
t.column(name, collate: .Rtrim)
972-
// name TEXT COLLATE "RTRIM"
972+
t.alter(table: users, add: name, collate: .Rtrim)
973+
// ALTER TABLE "users"
974+
// ADD COLUMN "name" TEXT COLLATE "RTRIM"
973975
```
974976

975977
- `references` adds a `REFERENCES` clause to `Int64` (and `Int64?`) column definitions and accepts a table or namespaced column expression. (See the `foreignKey` function under [Table Constraints](#table-constraints) for non-integer foreign key support.)

0 commit comments

Comments
 (0)