Skip to content
Snippets Groups Projects
Commit c5b83e11 authored by Balasankar "Balu" C's avatar Balasankar "Balu" C
Browse files

Store database migration paths as a map

parent a63a9ed4
No related branches found
No related tags found
3 merge requests!51Validate shift of Heptapod 0.25 to oldstable series,!47Making Heptapod 0.25 the new stable in Omnibus,!45GitLab 14.2
......@@ -19,6 +19,9 @@
module GitlabRails
ALLOWED_DATABASES = %w[main ci].freeze
DATABASE_MIGRATION_PATHS = {
ci: 'db/ci_migrate'
}.freeze
class << self
def parse_variables
......@@ -217,6 +220,8 @@
database_attributes.each do |attribute|
Gitlab['gitlab_rails']['databases'][database][attribute] ||= Gitlab['gitlab_rails']['databases']['main'][attribute]
end
Gitlab['gitlab_rails']['databases'][database]['database_migration_paths'] = DATABASE_MIGRATION_PATHS[database.to_sym]
end
end
......
......@@ -34,7 +34,7 @@
application_name: <%= quote(attributes['db_application_name']) %>
variables:
statement_timeout: <%= attributes['db_statement_timeout'] %>
<% if database != 'main' %>
migrations_paths: "db/<%= database %>_migrate"
<% if attributes.key?('database_migration_paths') %>
migrations_paths: <%= quote(attributes['database_migration_paths']) %>
<% end %>
<% end %>
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment