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 6363 - [ Renaming Columns] ( #renaming-columns )
6464 - [ Dropping Columns] ( #dropping-columns )
6565 - [ Renaming/Dropping Tables] ( #renamingdropping-tables )
66+ - [ Creating Tables] ( #creating-tables )
6667 - [ Indexes] ( #indexes )
6768 - [ Creating Indexes] ( #creating-indexes )
6869 - [ Dropping Indexes] ( #dropping-indexes )
@@ -1583,6 +1584,16 @@ try schemaChanger.rename(table: "users", to: "users_new")
15831584try schemaChanger.drop (table : " emails" , ifExists : false )
15841585```
15851586
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+
15861597### Indexes
15871598
15881599
You can’t perform that action at this time.
0 commit comments