Skip to content
This repository has been archived by the owner on Mar 1, 2023. It is now read-only.

feat: single transaction #7

Merged
merged 3 commits into from
Apr 24, 2021
Merged

feat: single transaction #7

merged 3 commits into from
Apr 24, 2021

Conversation

pleshevskiy
Copy link
Owner

@pleshevskiy pleshevskiy commented Apr 23, 2021

  • I added a single transaction option for apply, upgrade, and
    downgrade commands, which wraps all migrations into a single
    transaction. This gives you the ability to safely roll up
    migrations and, if some unforeseen situation occurs, roll them back.

Unfortunately if there is an error in syntax, mysql will not
rollback the migration and commits automatically :( I will
research this issue.

  • added support transactional ddl trait and implemented it for
    all supported clients

I didn't know that mysql doesn't support transactional ddl.
It means that we cannot create table, alter table and etc. in
transaction. At the moment migra supports only postgres client,
that can be use transaction for ddl.

Closes #2

I added a single transaction option for apply, upgrade, and
downgrade commands, which wraps all migrations into a single
transaction. This gives you the ability to safely roll up
migrations and, if some unforeseen situation occurs, roll them back.

Unfortunately if there is an error in syntax, mysql will not
rollback the migration and commits automatically :( I will
research this issue.

Closes #2
I didn't know that mysql doesn't support transactional ddl.
It means that we cannot create table, alter table and etc. in
transaction. At the moment migra supports only postgres client,
that can be use transaction for ddl.
@pleshevskiy pleshevskiy merged commit 25ea001 into main Apr 24, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Single transaction
1 participant