From dfa5b95284251e8d81b8b42fffa69924d9966167 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gwendal=20Roue=CC=81?= Date: Thu, 1 Oct 2015 19:17:13 +0200 Subject: [PATCH] README.md --- README.md | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 78a25a5d3..58749b18d 100644 --- a/README.md +++ b/README.md @@ -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 (...);" + + "...") } ```