Announce on which DB migration is run
What does this MR do and why?
This improves migration output to:
- prefix migration output with indicator of database on which it runs
- makes skipped migrations to also include announcements (migrating/migrated) with version and name
Resolves:
Related to:
Output
$ bin/rake db:migrate
main: == 20220516123101 AddTextLimitToGloballyAllowedIpsOnApplicationSettings: migrating
main: -- transaction_open?()
main: -> 0.0000s
main: -- current_schema()
main: -> 0.0010s
main: -- transaction_open?()
main: -> 0.0000s
main: -- execute("ALTER TABLE application_settings\nADD CONSTRAINT check_734cc9407a\nCHECK ( char_length(globally_allowed_ips) <= 255 )\nNOT VALID;\n")
main: -> 0.0028s
main: -- current_schema()
main: -> 0.0005s
main: -- execute("ALTER TABLE application_settings VALIDATE CONSTRAINT check_734cc9407a;")
main: -> 0.0011s
main: == 20220516123101 AddTextLimitToGloballyAllowedIpsOnApplicationSettings: migrated (0.0145s)
main: == 20220517144749 RemoveVulnerabilityApprovalRules: migrating ===============
main: -- The migration is skipped since it modifies the [:gitlab_main].
main: -- This database can only apply migrations in one of the following schemas: [:gitlab_ci, :gitlab_shared].
main: == 20220517144749 RemoveVulnerabilityApprovalRules: migrated (0.0001s) ======
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