File tree Expand file tree Collapse file tree 1 file changed +11
-0
lines changed Expand file tree Collapse file tree 1 file changed +11
-0
lines changed Original file line number Diff line number Diff line change 63
63
- [ Renaming Columns] ( #renaming-columns )
64
64
- [ Dropping Columns] ( #dropping-columns )
65
65
- [ Renaming/Dropping Tables] ( #renamingdropping-tables )
66
+ - [ Creating Tables] ( #creating-tables )
66
67
- [ Indexes] ( #indexes )
67
68
- [ Creating Indexes] ( #creating-indexes )
68
69
- [ Dropping Indexes] ( #dropping-indexes )
@@ -1583,6 +1584,16 @@ try schemaChanger.rename(table: "users", to: "users_new")
1583
1584
try schemaChanger.drop (table : " emails" , ifExists : false )
1584
1585
```
1585
1586
1587
+ #### Creating Tables
1588
+
1589
+ ```swift
1590
+ let schemaChanger = SchemaChanger (connection : db)
1591
+
1592
+ try schemaChanger.create (table : " users" ) { table in
1593
+ table.add (column : .init (name : " id" , primaryKey : .init (autoIncrement : true ), type : .INTEGER ))
1594
+ table.add (column : .init (name : " name" , type : .TEXT , nullable : false ))
1595
+ }
1596
+
1586
1597
### Indexes
1587
1598
1588
1599
You can’t perform that action at this time.
0 commit comments