From 993eaae2f7c276c1690717de7b84beb8d06b5e9a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gwendal=20Roue=CC=81?= Date: Wed, 4 Nov 2015 22:44:51 +0100 Subject: [PATCH] README.md --- README.md | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/README.md b/README.md index 90121bdab..1ee7939d1 100644 --- a/README.md +++ b/README.md @@ -1165,6 +1165,19 @@ NSBundle.mainBundle() } ``` +### Advanced Database Schema Changes + +SQLite does not support many schema changes, and won't let you drop a table column with "ALTER TABLE ... DROP COLUMN ...", for example. + +Yet any kind of schema change is still possible. The SQLite documentation explains in detail how to do so: https://www.sqlite.org/lang_altertable.html#otheralter. This technique requires the temporary disabling of foreign key checks, and is supported by a specific method of DatabaseMigrator: + +```swift +migrator.registerMigrationWithoutForeignKeyChecks("dropTableColumn") { db in + try db.execute("...") +} +``` + + ## Database Changes Observation The TransactionObserverType protocol lets you **observe database changes**: