Commit a3e47b2c authored by Stan Hu's avatar Stan Hu Committed by Rémy Coutable

Merge branch 'fix-migration-introduced-by-5387' into 'master'

Fix migration to make it fast

## What does this MR do?

Changing the migration introduced in !5387 so that it's fast. The idea is that the content of the `projects.has_external_wiki` is currently wrong, so we can just drop and recreate the column.

## Does this MR meet the acceptance criteria?

- [x] No CHANGELOG needed
- Tests
  - [ ] All builds are passing
- [x] Conform by the [style guides](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/CONTRIBUTING.md#style-guides)
- [x] Branch has no merge conflicts with `master` (if you do - rebase it please)
- [x] [Squashed related commits together](https://git-scm.com/book/en/Git-Tools-Rewriting-History#Squashing-Commits)

See merge request !5394
parent 3aa5bc69
class NullifyHasExternalWikiInProjects < ActiveRecord::Migration class DropAndReaddHasExternalWikiInProjects < ActiveRecord::Migration
include Gitlab::Database::MigrationHelpers include Gitlab::Database::MigrationHelpers
# Set this constant to true if this migration requires downtime. # Set this constant to true if this migration requires downtime.
DOWNTIME = false DOWNTIME = false
def up def up
execute("UPDATE projects SET has_external_wiki = NULL") remove_column :projects, :has_external_wiki, :boolean
add_column :projects, :has_external_wiki, :boolean
end end
def down def down
......
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