Create geo_node_group_links table

parent 8dfb9874
class CreateGeoNodeGroupLinks < ActiveRecord::Migration
include Gitlab::Database::MigrationHelpers
DOWNTIME = false
def change
create_table :geo_node_group_links do |t|
t.references :geo_node, index: true, foreign_key: { on_delete: :cascade }, null: false
t.integer :group_id, index: true, null: false
end
add_timestamps_with_timezone :geo_node_group_links
add_foreign_key :geo_node_group_links, :namespaces, column: :group_id, on_delete: :cascade
end
end
......@@ -633,6 +633,16 @@ ActiveRecord::Schema.define(version: 20170803130232) do
add_index "geo_event_log", ["repository_updated_event_id"], name: "index_geo_event_log_on_repository_updated_event_id", using: :btree
create_table "geo_node_group_links", force: :cascade do |t|
t.integer "geo_node_id", null: false
t.integer "group_id", null: false
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
end
add_index "geo_node_group_links", ["geo_node_id"], name: "index_geo_node_group_links_on_geo_node_id", using: :btree
add_index "geo_node_group_links", ["group_id"], name: "index_geo_node_group_links_on_group_id", using: :btree
create_table "geo_nodes", force: :cascade do |t|
t.string "schema"
t.string "host"
......@@ -1974,6 +1984,8 @@ ActiveRecord::Schema.define(version: 20170803130232) do
add_foreign_key "geo_event_log", "geo_repository_deleted_events", column: "repository_deleted_event_id", name: "fk_c4b1c1f66e", on_delete: :cascade
add_foreign_key "geo_event_log", "geo_repository_renamed_events", column: "repository_renamed_event_id", name: "fk_86c84214ec", on_delete: :cascade
add_foreign_key "geo_event_log", "geo_repository_updated_events", column: "repository_updated_event_id", on_delete: :cascade
add_foreign_key "geo_node_group_links", "geo_nodes", on_delete: :cascade
add_foreign_key "geo_node_group_links", "namespaces", column: "group_id", on_delete: :cascade
add_foreign_key "geo_repository_renamed_events", "projects", on_delete: :cascade
add_foreign_key "geo_repository_updated_events", "projects", on_delete: :cascade
add_foreign_key "index_statuses", "projects", name: "fk_74b2492545", 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