Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/db
diff options
context:
space:
mode:
authorKamil Trzciński <ayufan@ayufan.eu>2017-03-06 23:02:52 +0300
committerKamil Trzciński <ayufan@ayufan.eu>2017-03-06 23:02:52 +0300
commitb70d151db99d6d64f3514006c4fa6c8142e1b785 (patch)
treec6feb891fc752583f7cde7a8e7536ab607490f72 /db
parent03b310895b2a41a7cc8331fac6f3e9c9f9687a26 (diff)
parent2199906dcad070c4599c445317f9fb02899d1d0f (diff)
Merge branch 'zj-create-mattermost-team' into 'master'
Create Mattermost Team from GitLab Closes #23964 See merge request !8746
Diffstat (limited to 'db')
-rw-r--r--db/migrate/20170120131253_create_chat_teams.rb18
-rw-r--r--db/schema.rb11
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 6f7dd3e4768..94fd64bc561 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"
@@ -1338,6 +1348,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