H -->|No| I[Post-deploy migration<br/>+ feature flag]
H -->|No| I[Post-deploy migration<br/>+ feature flag]
D -->|Yes| F[Post-deploy migration]
D -->|Yes| F[Post-deploy migration]
D -->|No| G[Background migration]
D -->|No| G[Background migration]
```
```
...
@@ -256,8 +256,6 @@ lock allow the database to process other statements.
...
@@ -256,8 +256,6 @@ lock allow the database to process other statements.
**Removing a column:**
**Removing a column:**
```ruby
```ruby
includeGitlab::Database::MigrationHelpers
defup
defup
with_lock_retriesdo
with_lock_retriesdo
remove_column:users,:full_name
remove_column:users,:full_name
...
@@ -278,8 +276,6 @@ you should do as much as possible inside the transaction rather than trying to g
...
@@ -278,8 +276,6 @@ you should do as much as possible inside the transaction rather than trying to g
Be careful about running long database statements within the block. The acquired locks are kept until the transaction (block) finishes and depending on the lock type, it might block other database operations.
Be careful about running long database statements within the block. The acquired locks are kept until the transaction (block) finishes and depending on the lock type, it might block other database operations.
@@ -974,7 +962,7 @@ If you need more complex logic, you can define and use models local to a
...
@@ -974,7 +962,7 @@ If you need more complex logic, you can define and use models local to a
migration. For example:
migration. For example:
```ruby
```ruby
classMyMigration<ActiveRecord::Migration[6.0]
classMyMigration<Gitlab::Database::Migration[1.0]
classProject<ActiveRecord::Base
classProject<ActiveRecord::Base
self.table_name='projects'
self.table_name='projects'
end
end
...
@@ -1073,7 +1061,7 @@ in a previous migration.
...
@@ -1073,7 +1061,7 @@ in a previous migration.
It is important not to leave out the `User.reset_column_information` command, in order to ensure that the old schema is dropped from the cache and ActiveRecord loads the updated schema information.
It is important not to leave out the `User.reset_column_information` command, in order to ensure that the old schema is dropped from the cache and ActiveRecord loads the updated schema information.