nkonev / r2dbc-migrate

R2DBC database migration library
https://nkonev.name/post/136
Apache License 2.0
98 stars 9 forks source link

Add implementation with advisory(session) lock #28

Closed nkonev closed 1 year ago

nkonev commented 1 year ago

See https://github.com/blagerweij/liquibase-sessionlock

nkonev commented 1 year ago

Upd:

Starting from 2.9.0 so-called database-specific lock was implemented. It is advisory lock in case PostgreSQL, session lock in case MySQL and MariaDB. For other databases it is (still) usual table-based lock. This means, if you migrating from 2.8.x in case before mentioned databases you can remove your lock table by

drop table migrations_lock;

If you want to preserve old behavior - you can set

r2dbc:
  migrate:
    prefer-db-specific-lock: false
nkonev commented 1 year ago

SQL Server and H2 aren't seen very popular, leaving them with table locking for now, session lock can be implemented in the future or by demand.