mirror of
https://github.com/groue/GRDB.swift
synced 2026-11-26 04:07:50 +00:00
README.md
This commit is contained in:
1 parent
970ef4e660
commit
dfa5b95284
1 file changed
+5
-2
@@ -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 (...);" +
|
||||
"...")
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
Reference in new issue
Block a user