Move geo database paths to db/geo rather than a root-level db_geo

parent d65550ca
...@@ -20,7 +20,7 @@ AllCops: ...@@ -20,7 +20,7 @@ AllCops:
- 'node_modules/**/*' - 'node_modules/**/*'
- 'db/*' - 'db/*'
- 'db/fixtures/**/*' - 'db/fixtures/**/*'
- 'db_geo/*' - 'db/geo/*'
- 'tmp/**/*' - 'tmp/**/*'
- 'bin/**/*' - 'bin/**/*'
- 'generator_templates/**/*' - 'generator_templates/**/*'
......
...@@ -12,6 +12,7 @@ ...@@ -12,6 +12,7 @@
# It's strongly recommended that you check this file into your version control system. # It's strongly recommended that you check this file into your version control system.
ActiveRecord::Schema.define(version: 20170302005747) do ActiveRecord::Schema.define(version: 20170302005747) do
# These are extensions that must be enabled in order to support this database # These are extensions that must be enabled in order to support this database
enable_extension "plpgsql" enable_extension "plpgsql"
...@@ -23,4 +24,5 @@ ActiveRecord::Schema.define(version: 20170302005747) do ...@@ -23,4 +24,5 @@ ActiveRecord::Schema.define(version: 20170302005747) do
end end
add_index "project_registry", ["project_id"], name: "index_project_registry_on_project_id", using: :btree add_index "project_registry", ["project_id"], name: "index_project_registry_on_project_id", using: :btree
end end
...@@ -12,6 +12,6 @@ class GeoMigrationGenerator < ActiveRecord::Generators::MigrationGenerator ...@@ -12,6 +12,6 @@ class GeoMigrationGenerator < ActiveRecord::Generators::MigrationGenerator
def create_migration_file def create_migration_file
set_local_assigns! set_local_assigns!
validate_file_name! validate_file_name!
migration_template @migration_template, "db_geo/migrate/#{file_name}.rb" migration_template @migration_template, "db/geo/migrate/#{file_name}.rb"
end end
end end
...@@ -18,7 +18,7 @@ module Gitlab ...@@ -18,7 +18,7 @@ module Gitlab
def self.db_migrate_path def self.db_migrate_path
# Lazy initialisation so Rails.root will be defined # Lazy initialisation so Rails.root will be defined
@db_migrate_path ||= File.join(Rails.root, 'db_geo', 'migrate') @db_migrate_path ||= File.join(Rails.root, 'db', 'geo', 'migrate')
end end
def self.get_database_version def self.get_database_version
......
...@@ -54,11 +54,11 @@ namespace :geo do ...@@ -54,11 +54,11 @@ namespace :geo do
} }
# set config variables for geo database # set config variables for geo database
ENV['SCHEMA'] = 'db_geo/schema.rb' ENV['SCHEMA'] = 'db/geo/schema.rb'
ENV['SKIP_POST_DEPLOYMENT_MIGRATIONS'] = 'true' ENV['SKIP_POST_DEPLOYMENT_MIGRATIONS'] = 'true'
Rails.application.config.paths['db'] = ['db_geo'] Rails.application.config.paths['db'] = ['db/geo']
Rails.application.config.paths['db/migrate'] = ['db_geo/migrate'] Rails.application.config.paths['db/migrate'] = ['db/geo/migrate']
Rails.application.config.paths['db/seeds.rb'] = ['db_geo/seeds.rb'] Rails.application.config.paths['db/seeds.rb'] = ['db/geo/seeds.rb']
Rails.application.config.paths['config/database'] = ['config/database_geo.yml'] Rails.application.config.paths['config/database'] = ['config/database_geo.yml']
end end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment