From 0e161f43df9892cb6f29f16cdbc98b50caa12d55 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Philippe=20Lafoucrie=CC=80re?= Date: Wed, 25 Jan 2017 20:38:38 -0500 Subject: [PATCH] Add more doc for disabled transactions --- driver/postgres/README.md | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/driver/postgres/README.md b/driver/postgres/README.md index 61cdf00..0983629 100644 --- a/driver/postgres/README.md +++ b/driver/postgres/README.md @@ -27,5 +27,10 @@ Since all migrations are executed in a transaction block by default (per migrati -- disable_ddl_transaction alter type ...; ``` + The option `disable_ddl_transaction` must be in a sql comment of the first line of the migration file. -If set, the driver will execute the file content directly. + +Please note that you can't put several `alter type ... add value ...` in a single file. Doing so will result in a `ERROR 25001: ALTER TYPE ... ADD cannot be executed from a function or multi-command string` sql exception during migration. + +Since the file will be executed without transaction, it's probably not a good idea to exec more than one statement anyway. If the last statement of the file fails, chances to run again the migration without error will be very limited. +