File tree Expand file tree Collapse file tree 4 files changed +5
-5
lines changed Expand file tree Collapse file tree 4 files changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -1533,7 +1533,7 @@ let newColumn = ColumnDefinition(
15331533let schemaChanger = SchemaChanger (connection : db)
15341534
15351535try schemaChanger.alter (table : " users" ) { table in
1536- table.add (newColumn)
1536+ table.add (column : newColumn)
15371537}
15381538```
15391539
Original file line number Diff line number Diff line change @@ -115,7 +115,7 @@ print(columns)
115115
116116let schemaChanger = SchemaChanger ( connection: db)
117117try schemaChanger. alter ( table: " users " ) { table in
118- table. add ( ColumnDefinition ( name: " age " , type: . INTEGER) )
118+ table. add ( column : ColumnDefinition ( name: " age " , type: . INTEGER) )
119119 table. rename ( column: " email " , to: " electronic_mail " )
120120 table. drop ( column: " name " )
121121}
Original file line number Diff line number Diff line change @@ -95,7 +95,7 @@ public class SchemaChanger: CustomStringConvertible {
9595 self . name = name
9696 }
9797
98- public func add( _ column: ColumnDefinition ) {
98+ public func add( column: ColumnDefinition ) {
9999 operations. append ( . addColumn( column) )
100100 }
101101
Original file line number Diff line number Diff line change @@ -99,7 +99,7 @@ class SchemaChangerTests: SQLiteTestCase {
9999 defaultValue: . stringLiteral( " foo " ) )
100100
101101 try schemaChanger. alter ( table: " users " ) { table in
102- table. add ( newColumn)
102+ table. add ( column : newColumn)
103103 }
104104
105105 let columns = try schema. columnDefinitions ( table: " users " )
@@ -114,7 +114,7 @@ class SchemaChangerTests: SQLiteTestCase {
114114 type: . TEXT)
115115
116116 XCTAssertThrowsError ( try schemaChanger. alter ( table: " users " ) { table in
117- table. add ( newColumn)
117+ table. add ( column : newColumn)
118118 } ) { error in
119119 if case SchemaChanger . Error . invalidColumnDefinition( _) = error {
120120 XCTAssertEqual ( " Invalid column definition: can not add primary key column " , error. localizedDescription)
You can’t perform that action at this time.
0 commit comments