Commit c197361d authored by Oswaldo Ferreira's avatar Oswaldo Ferreira

Add board assignees table creation migration

parent 8db002a9
class CreateBoardAssignees < ActiveRecord::Migration
DOWNTIME = false
disable_ddl_transaction!
def change
create_table :board_assignees do |t|
t.references :board, index: true, foreign_key: { on_delete: :cascade }, null: false
t.integer :assignee_id, null: false, index: true
t.foreign_key :users, column: :assignee_id, on_delete: :cascade
t.index [:board_id, :assignee_id], unique: true
end
end
end
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,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: 20170926203418) do ActiveRecord::Schema.define(version: 20171010095526) 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"
...@@ -214,6 +214,15 @@ ActiveRecord::Schema.define(version: 20170926203418) do ...@@ -214,6 +214,15 @@ ActiveRecord::Schema.define(version: 20170926203418) do
add_index "award_emoji", ["awardable_type", "awardable_id"], name: "index_award_emoji_on_awardable_type_and_awardable_id", using: :btree add_index "award_emoji", ["awardable_type", "awardable_id"], name: "index_award_emoji_on_awardable_type_and_awardable_id", using: :btree
add_index "award_emoji", ["user_id", "name"], name: "index_award_emoji_on_user_id_and_name", using: :btree add_index "award_emoji", ["user_id", "name"], name: "index_award_emoji_on_user_id_and_name", using: :btree
create_table "board_assignees", force: :cascade do |t|
t.integer "board_id", null: false
t.integer "assignee_id", null: false
end
add_index "board_assignees", ["assignee_id"], name: "index_board_assignees_on_assignee_id", using: :btree
add_index "board_assignees", ["board_id", "assignee_id"], name: "index_board_assignees_on_board_id_and_assignee_id", unique: true, using: :btree
add_index "board_assignees", ["board_id"], name: "index_board_assignees_on_board_id", using: :btree
create_table "board_labels", force: :cascade do |t| create_table "board_labels", force: :cascade do |t|
t.integer "board_id", null: false t.integer "board_id", null: false
t.integer "label_id", null: false t.integer "label_id", null: false
...@@ -231,10 +240,8 @@ ActiveRecord::Schema.define(version: 20170926203418) do ...@@ -231,10 +240,8 @@ ActiveRecord::Schema.define(version: 20170926203418) do
t.integer "milestone_id" t.integer "milestone_id"
t.integer "group_id" t.integer "group_id"
t.integer "weight" t.integer "weight"
t.integer "assignee_id"
end end
add_index "boards", ["assignee_id"], name: "index_boards_on_assignee_id", using: :btree
add_index "boards", ["group_id"], name: "index_boards_on_group_id", using: :btree add_index "boards", ["group_id"], name: "index_boards_on_group_id", using: :btree
add_index "boards", ["milestone_id"], name: "index_boards_on_milestone_id", using: :btree add_index "boards", ["milestone_id"], name: "index_boards_on_milestone_id", using: :btree
add_index "boards", ["project_id"], name: "index_boards_on_project_id", using: :btree add_index "boards", ["project_id"], name: "index_boards_on_project_id", using: :btree
...@@ -2059,11 +2066,12 @@ ActiveRecord::Schema.define(version: 20170926203418) do ...@@ -2059,11 +2066,12 @@ ActiveRecord::Schema.define(version: 20170926203418) do
add_foreign_key "approvals", "merge_requests", name: "fk_310d714958", on_delete: :cascade add_foreign_key "approvals", "merge_requests", name: "fk_310d714958", on_delete: :cascade
add_foreign_key "approver_groups", "namespaces", column: "group_id", on_delete: :cascade add_foreign_key "approver_groups", "namespaces", column: "group_id", on_delete: :cascade
add_foreign_key "board_assignees", "boards", on_delete: :cascade
add_foreign_key "board_assignees", "users", column: "assignee_id", on_delete: :cascade
add_foreign_key "board_labels", "boards", on_delete: :cascade add_foreign_key "board_labels", "boards", on_delete: :cascade
add_foreign_key "board_labels", "labels", on_delete: :cascade add_foreign_key "board_labels", "labels", on_delete: :cascade
add_foreign_key "boards", "namespaces", column: "group_id", name: "fk_1e9a074a35", on_delete: :cascade add_foreign_key "boards", "namespaces", column: "group_id", name: "fk_1e9a074a35", on_delete: :cascade
add_foreign_key "boards", "projects", name: "fk_f15266b5f9", on_delete: :cascade add_foreign_key "boards", "projects", name: "fk_f15266b5f9", on_delete: :cascade
add_foreign_key "boards", "users", column: "assignee_id", name: "fk_2a3450e77c", on_delete: :nullify
add_foreign_key "chat_teams", "namespaces", on_delete: :cascade add_foreign_key "chat_teams", "namespaces", on_delete: :cascade
add_foreign_key "ci_builds", "ci_pipelines", column: "auto_canceled_by_id", name: "fk_a2141b1522", on_delete: :nullify add_foreign_key "ci_builds", "ci_pipelines", column: "auto_canceled_by_id", name: "fk_a2141b1522", on_delete: :nullify
add_foreign_key "ci_builds", "ci_stages", column: "stage_id", name: "fk_3a9eaa254d", on_delete: :cascade add_foreign_key "ci_builds", "ci_stages", column: "stage_id", name: "fk_3a9eaa254d", on_delete: :cascade
......
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