Draft: Skip migrations from running when `database_tasks: false` is set
What does this MR do and why?
It does use information of database_tasks: false
to know that such connections are being shared
with main:
(a primary connection).
The usage of database_tasks: false
makes to not run migrations on top of connection marked as this
like ci:
. To ensure that database_tasks: true/false
is properly used this does implement gitlab:db:validate_config
for that.
This does solve migrations skipping/restrict approach since:
- If
database_tasks: true
is used, the migration will be run everywhere, but some withrestrict*
will be skipped (a message will be printed, and they will be marked viaschema_migrations
as run) - If
database_tasks: false
is used, the migration will be run only onmain:
, since nodb:migrate:ci
will exist. Such migration will not be skipped, and instead it will be run in-order on top ofmain:
This:
- Based on top of !73756 (merged)
- Uses the !82902 (merged) (single commit picked)
- Implements Solution 2 of the #355014 (closed)
This makes it possible to softly skip migrations (print information) if we have two connections using two databases.
Resolves:
Related:
MR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
-
I have evaluated the MR acceptance checklist for this MR.
Edited by Kamil Trzciński (Back 2025-01-01)