Commit 67894f8f authored by GitLab Bot's avatar GitLab Bot

Automatic merge of gitlab-org/gitlab master

parents a5df726d 5c16ff17
39a79b3bde65993fd219faf35f24c77d85b357aa
d554b758056dd291fec6fbe6083e941ccf316fdb
......@@ -7,7 +7,7 @@ module Ci
# This class is part of a migration to move all CI classes to a new separate database.
# Initially we are only going to be moving the `Ci::InstanceVariable` model and it will be duplicated in the main and CI tables
# Do not extend this class in any other models.
class ApplicationRecord < ::ApplicationRecord
class BaseModel < ::ApplicationRecord
self.abstract_class = true
if Gitlab::Database.has_config?(:ci)
......
# frozen_string_literal: true
module Ci
class InstanceVariable < ::Ci::ApplicationRecord
class InstanceVariable < ::Ci::BaseModel
extend Gitlab::Ci::Model
extend Gitlab::ProcessMemoryCache::Helper
include Ci::NewHasVariable
......
......@@ -95,7 +95,7 @@ database. This is to match the default name Rails has.
### Migrations
Any migrations that affect `Ci::ApplicationRecord` models
Any migrations that affect `Ci::BaseModel` models
and their tables must be placed in two directories for now:
- `db/migrate`
......
......@@ -28,7 +28,8 @@ Guide](migration_style_guide.md) for more information.
Keep in mind that you can only safely add foreign keys to existing tables after
you have removed any orphaned rows. The method `add_concurrent_foreign_key`
does not take care of this so you'll need to do so manually.
does not take care of this so you'll need to do so manually. See
[adding foreign key constraint to an existing column](database/add_foreign_key_to_existing_column.md).
## Cascading Deletes
......
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