From 0d2ede4440170d31a7ebee165e1e3443090c488d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gwendal=20Roue=CC=81?= Date: Thu, 27 Feb 2020 08:43:51 +0100 Subject: [PATCH] Document that migrations run with deferred foreign key checks --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 0c770b55d..768b36ece 100644 --- a/README.md +++ b/README.md @@ -4921,6 +4921,8 @@ migrator.registerMigration("v2") { db in **Each migration runs in a separate transaction.** Should one throw an error, its transaction is rollbacked, subsequent migrations do not run, and the error is eventually thrown by `migrator.migrate(dbQueue)`. +**Migrations run with deferred foreign key checks,** starting SQLite 3.7.16+ (iOS 9.0+ / macOS 10.10+ / tvOS 9.0+ / watchOS 2.0+ / [custom SQLite build] / [SQLCipher](#encryption)). This means that eventual foreign key violations are only checked at the end of the migration (and they make the migration fail). + **The memory of applied migrations is stored in the database itself** (in a reserved table). You migrate the database up to the latest version with the `migrate(_:)` method: