Skip to content
This repository has been archived by the owner on Feb 9, 2024. It is now read-only.

Commit

Permalink
Add more doc for disabled transactions
Browse files Browse the repository at this point in the history
  • Loading branch information
Philippe Lafoucrière committed Jan 26, 2017
1 parent 221ffae commit 0e161f4
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion driver/postgres/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

0 comments on commit 0e161f4

Please sign in to comment.