Commit 0f59d73e authored by Felipe Artur's avatar Felipe Artur Committed by Andreas Brandl

Rename epic column state to state_id

Rename epic column state to state_id to be consistent with
issues and merge requests
parent c9656258
---
title: Rename epic column state to state_id
merge_request: 32270
author:
type: changed
# frozen_string_literal: true
class RenameEpicsStateToStateId < ActiveRecord::Migration[5.2]
include Gitlab::Database::MigrationHelpers
DOWNTIME = false
disable_ddl_transaction!
def up
rename_column_concurrently :epics, :state, :state_id
end
def down
cleanup_concurrent_column_rename :epics, :state_id, :state
end
end
# frozen_string_literal: true
class CleanupEpicsStateIdRename < ActiveRecord::Migration[5.2]
include Gitlab::Database::MigrationHelpers
DOWNTIME = false
disable_ddl_transaction!
def up
cleanup_concurrent_column_rename :epics, :state, :state_id
end
def down
rename_column_concurrently :epics, :state_id, :state
end
end
...@@ -1286,11 +1286,11 @@ ActiveRecord::Schema.define(version: 2019_08_28_083843) do ...@@ -1286,11 +1286,11 @@ ActiveRecord::Schema.define(version: 2019_08_28_083843) do
t.date "due_date_fixed" t.date "due_date_fixed"
t.boolean "start_date_is_fixed" t.boolean "start_date_is_fixed"
t.boolean "due_date_is_fixed" t.boolean "due_date_is_fixed"
t.integer "state", limit: 2, default: 1, null: false
t.integer "closed_by_id" t.integer "closed_by_id"
t.datetime "closed_at" t.datetime "closed_at"
t.integer "parent_id" t.integer "parent_id"
t.integer "relative_position" t.integer "relative_position"
t.integer "state_id", limit: 2, default: 1, null: false
t.index ["assignee_id"], name: "index_epics_on_assignee_id" t.index ["assignee_id"], name: "index_epics_on_assignee_id"
t.index ["author_id"], name: "index_epics_on_author_id" t.index ["author_id"], name: "index_epics_on_author_id"
t.index ["closed_by_id"], name: "index_epics_on_closed_by_id" t.index ["closed_by_id"], name: "index_epics_on_closed_by_id"
......
...@@ -30,7 +30,7 @@ describe 'Database schema' do ...@@ -30,7 +30,7 @@ describe 'Database schema' do
draft_notes: %w[discussion_id commit_id], draft_notes: %w[discussion_id commit_id],
emails: %w[user_id], emails: %w[user_id],
events: %w[target_id], events: %w[target_id],
epics: %w[updated_by_id last_edited_by_id start_date_sourcing_milestone_id due_date_sourcing_milestone_id], epics: %w[updated_by_id last_edited_by_id start_date_sourcing_milestone_id due_date_sourcing_milestone_id state_id],
forked_project_links: %w[forked_from_project_id], forked_project_links: %w[forked_from_project_id],
geo_event_log: %w[hashed_storage_attachments_event_id], geo_event_log: %w[hashed_storage_attachments_event_id],
geo_job_artifact_deleted_events: %w[job_artifact_id], geo_job_artifact_deleted_events: %w[job_artifact_id],
......
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