Skip to content

Commit 0e161f4

Browse files
author
Philippe Lafoucrière
committed
Add more doc for disabled transactions
1 parent 221ffae commit 0e161f4

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

driver/postgres/README.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,5 +27,10 @@ Since all migrations are executed in a transaction block by default (per migrati
2727
-- disable_ddl_transaction
2828
alter type ...;
2929
```
30+
3031
The option `disable_ddl_transaction` must be in a sql comment of the first line of the migration file.
31-
If set, the driver will execute the file content directly.
32+
33+
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.
34+
35+
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.
36+

0 commit comments

Comments
 (0)