diff options
author | Douwe Maan <douwe@gitlab.com> | 2017-03-06 21:13:27 +0000 |
---|---|---|
committer | Douwe Maan <douwe@gitlab.com> | 2017-03-06 21:13:27 +0000 |
commit | d617182a1a6f9b19a8a6d117fa3e507fa2b338a8 (patch) | |
tree | e24db462cfb8ed1854e2203a78d6d22b071232e5 /db | |
parent | f96d5112dca596fb85718b3cca2a7b30b3877207 (diff) | |
parent | b70d151db99d6d64f3514006c4fa6c8142e1b785 (diff) | |
download | gitlab-ce-d617182a1a6f9b19a8a6d117fa3e507fa2b338a8.tar.gz |
Merge branch 'master' into 'rs-carrierwave-db'rs-carrierwave-db
# Conflicts:
# spec/models/group_spec.rb
Diffstat (limited to 'db')
-rw-r--r-- | db/migrate/20170120131253_create_chat_teams.rb | 18 | ||||
-rw-r--r-- | db/schema.rb | 11 |
2 files changed, 29 insertions, 0 deletions
diff --git a/db/migrate/20170120131253_create_chat_teams.rb b/db/migrate/20170120131253_create_chat_teams.rb new file mode 100644 index 00000000000..7995d383986 --- /dev/null +++ b/db/migrate/20170120131253_create_chat_teams.rb @@ -0,0 +1,18 @@ +class CreateChatTeams < ActiveRecord::Migration + include Gitlab::Database::MigrationHelpers + + DOWNTIME = true + DOWNTIME_REASON = "Adding a foreign key" + + disable_ddl_transaction! + + def change + create_table :chat_teams do |t| + t.references :namespace, null: false, index: { unique: true }, foreign_key: { on_delete: :cascade } + t.string :team_id + t.string :name + + t.timestamps null: false + end + end +end diff --git a/db/schema.rb b/db/schema.rb index 9f31ee8e6c5..624cf9432d0 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -175,6 +175,16 @@ ActiveRecord::Schema.define(version: 20170306170512) do add_index "chat_names", ["service_id", "team_id", "chat_id"], name: "index_chat_names_on_service_id_and_team_id_and_chat_id", unique: true, using: :btree add_index "chat_names", ["user_id", "service_id"], name: "index_chat_names_on_user_id_and_service_id", unique: true, using: :btree + create_table "chat_teams", force: :cascade do |t| + t.integer "namespace_id", null: false + t.string "team_id" + t.string "name" + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + end + + add_index "chat_teams", ["namespace_id"], name: "index_chat_teams_on_namespace_id", unique: true, using: :btree + create_table "ci_application_settings", force: :cascade do |t| t.boolean "all_broken_builds" t.boolean "add_pusher" @@ -1352,6 +1362,7 @@ ActiveRecord::Schema.define(version: 20170306170512) do add_index "web_hooks", ["project_id"], name: "index_web_hooks_on_project_id", using: :btree add_foreign_key "boards", "projects" + add_foreign_key "chat_teams", "namespaces", on_delete: :cascade add_foreign_key "ci_triggers", "users", column: "owner_id", name: "fk_e8e10d1964", on_delete: :cascade add_foreign_key "issue_metrics", "issues", on_delete: :cascade add_foreign_key "label_priorities", "labels", on_delete: :cascade |