File tree Expand file tree Collapse file tree 1 file changed +12
-11
lines changed Expand file tree Collapse file tree 1 file changed +12
-11
lines changed Original file line number Diff line number Diff line change @@ -13,21 +13,22 @@ class SQLiteTestCase : XCTestCase {
1313
1414 db. trace { SQL in
1515 print ( SQL)
16- self . trace [ SQL] = ( self . trace [ SQL ] ?? 0 ) + 1
16+ self . trace [ SQL, default : 0 ] += 1
1717 }
1818 }
1919
2020 func CreateUsersTable( ) {
21- try ! db. execute (
22- " CREATE TABLE \" users \" ( " +
23- " id INTEGER PRIMARY KEY, " +
24- " email TEXT NOT NULL UNIQUE, " +
25- " age INTEGER, " +
26- " salary REAL, " +
27- " admin BOOLEAN NOT NULL DEFAULT 0 CHECK (admin IN (0, 1)), " +
28- " manager_id INTEGER, " +
29- " FOREIGN KEY(manager_id) REFERENCES users(id) " +
30- " ) "
21+ try ! db. execute ( """
22+ CREATE TABLE users (
23+ id INTEGER PRIMARY KEY,
24+ email TEXT NOT NULL UNIQUE,
25+ age INTEGER,
26+ salary REAL,
27+ admin BOOLEAN NOT NULL DEFAULT 0 CHECK (admin IN (0, 1)),
28+ manager_id INTEGER,
29+ FOREIGN KEY(manager_id) REFERENCES users(id)
30+ )
31+ """
3132 )
3233 }
3334
You can’t perform that action at this time.
0 commit comments