README.md

This commit is contained in:
Gwendal Roué committed 2015-10-01 19:17:13 +02:00
1 parent 970ef4e660
commit dfa5b95284
1 file changed
+5 -2
+5 -2
View File
@@ -911,13 +911,16 @@ migrator.registerMigration("AddAgeToPersons") { db in
try migrator.migrate(dbQueue)
```
You might prefer to use Database.executeMultiStatement(). This method takes a SQL string containing multiple statements separated by semi-colons.
Each migration runs in a separate transaction. Should one throw an error, its transaction is rollbacked, and subsequent migrations do not run.
You might use Database.executeMultiStatement(): this method takes a SQL string containing multiple statements separated by semi-colons:
```swift
migrator.registerMigration("createTables") { db in
try db.executeMultiStatement(
"CREATE TABLE persons (...);" +
"CREATE TABLE books (...)")
"CREATE TABLE books (...);" +
"...")
}
```