Commit 238ef8a1 authored by Oswaldo Ferreira's avatar Oswaldo Ferreira

Add single column indexes and foreign keys

parent bbe9cd8d
......@@ -5,12 +5,15 @@ class CreateRelatedIssuesTable < ActiveRecord::Migration
def change
create_table :related_issues do |t|
t.integer :issue_id, null: false
t.integer :related_issue_id, null: false
t.integer :issue_id, null: false, index: true
t.integer :related_issue_id, null: false, index: true
t.timestamps null: true
end
add_index :related_issues, [:issue_id, :related_issue_id], unique: true
add_foreign_key :related_issues, :issues, column: :issue_id
add_foreign_key :related_issues, :issues, column: :related_issue_id
end
end
......@@ -1312,6 +1312,8 @@ ActiveRecord::Schema.define(version: 20170602003304) do
end
add_index "related_issues", ["issue_id", "related_issue_id"], name: "index_related_issues_on_issue_id_and_related_issue_id", unique: true, using: :btree
add_index "related_issues", ["issue_id"], name: "index_related_issues_on_issue_id", using: :btree
add_index "related_issues", ["related_issue_id"], name: "index_related_issues_on_related_issue_id", using: :btree
create_table "releases", force: :cascade do |t|
t.string "tag"
......@@ -1745,6 +1747,8 @@ ActiveRecord::Schema.define(version: 20170602003304) do
add_foreign_key "protected_tag_create_access_levels", "namespaces", column: "group_id"
add_foreign_key "protected_tag_create_access_levels", "protected_tags"
add_foreign_key "protected_tag_create_access_levels", "users"
add_foreign_key "related_issues", "issues"
add_foreign_key "related_issues", "issues", column: "related_issue_id"
add_foreign_key "remote_mirrors", "projects"
add_foreign_key "subscriptions", "projects", on_delete: :cascade
add_foreign_key "system_note_metadata", "notes", name: "fk_d83a918cb1", 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