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(
1533
1533
let schemaChanger = SchemaChanger (connection : db)
1534
1534
1535
1535
try schemaChanger.alter (table : " users" ) { table in
1536
- table.add (newColumn)
1536
+ table.add (column : newColumn)
1537
1537
}
1538
1538
```
1539
1539
Original file line number Diff line number Diff line change @@ -115,7 +115,7 @@ print(columns)
115
115
116
116
let schemaChanger = SchemaChanger ( connection: db)
117
117
try schemaChanger. alter ( table: " users " ) { table in
118
- table. add ( ColumnDefinition ( name: " age " , type: . INTEGER) )
118
+ table. add ( column : ColumnDefinition ( name: " age " , type: . INTEGER) )
119
119
table. rename ( column: " email " , to: " electronic_mail " )
120
120
table. drop ( column: " name " )
121
121
}
Original file line number Diff line number Diff line change @@ -95,7 +95,7 @@ public class SchemaChanger: CustomStringConvertible {
95
95
self . name = name
96
96
}
97
97
98
- public func add( _ column: ColumnDefinition ) {
98
+ public func add( column: ColumnDefinition ) {
99
99
operations. append ( . addColumn( column) )
100
100
}
101
101
Original file line number Diff line number Diff line change @@ -99,7 +99,7 @@ class SchemaChangerTests: SQLiteTestCase {
99
99
defaultValue: . stringLiteral( " foo " ) )
100
100
101
101
try schemaChanger. alter ( table: " users " ) { table in
102
- table. add ( newColumn)
102
+ table. add ( column : newColumn)
103
103
}
104
104
105
105
let columns = try schema. columnDefinitions ( table: " users " )
@@ -114,7 +114,7 @@ class SchemaChangerTests: SQLiteTestCase {
114
114
type: . TEXT)
115
115
116
116
XCTAssertThrowsError ( try schemaChanger. alter ( table: " users " ) { table in
117
- table. add ( newColumn)
117
+ table. add ( column : newColumn)
118
118
} ) { error in
119
119
if case SchemaChanger . Error . invalidColumnDefinition( _) = error {
120
120
XCTAssertEqual ( " Invalid column definition: can not add primary key column " , error. localizedDescription)
You can’t perform that action at this time.
0 commit comments