diff --git a/DemoApps/GRDBDemoiOS/GRDBDemoiOS/Database.swift b/DemoApps/GRDBDemoiOS/GRDBDemoiOS/Database.swift index 66bc07861..2a28c340a 100644 --- a/DemoApps/GRDBDemoiOS/GRDBDemoiOS/Database.swift +++ b/DemoApps/GRDBDemoiOS/GRDBDemoiOS/Database.swift @@ -28,13 +28,11 @@ func setupDatabase(application: UIApplication) { migrator.registerMigration("createPersons") { db in // Have person names compared in a localized case insensitive fashion // See https://github.com/groue/GRDB.swift/#unicode - let collation = DatabaseCollation.localizedCaseInsensitiveCompare - try db.execute( - "CREATE TABLE persons (" + - "id INTEGER PRIMARY KEY, " + - "name TEXT NOT NULL COLLATE \(collation.name), " + - "score INTEGER NOT NULL " + - ")") + try db.create(table: "persons") { t in + t.column("id", .Integer).primaryKey() + t.column("name", .Text).notNull().collate(.localizedCaseInsensitiveCompare) + t.column("score", .Integer).notNull() + } } migrator.registerMigration("addPersons") { db in diff --git a/DemoApps/GRDBDemoiOS/GRDBDemoiOS/PersonsViewController.swift b/DemoApps/GRDBDemoiOS/GRDBDemoiOS/PersonsViewController.swift index 15f54c1f4..d59602843 100644 --- a/DemoApps/GRDBDemoiOS/GRDBDemoiOS/PersonsViewController.swift +++ b/DemoApps/GRDBDemoiOS/GRDBDemoiOS/PersonsViewController.swift @@ -187,7 +187,7 @@ extension PersonsViewController { @IBAction func stressTest() { setEditing(false, animated: true) - for _ in 0..<1000 { + for _ in 0..<50 { dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0)) { try! dbQueue.inTransaction { db in if Person.fetchCount(db) == 0 {