diff options
author | James Fargher <proglottis@gmail.com> | 2019-02-07 00:53:54 +0300 |
---|---|---|
committer | James Fargher <proglottis@gmail.com> | 2019-02-08 00:55:55 +0300 |
commit | 45cecae93a47d3c914bd4ec6778d23b412870a7b (patch) | |
tree | 8994d4b91d1082af0c706ff559e7d7d77e75f002 /db/migrate/20180209115333_create_chatops_tables.rb | |
parent | 35bc3906d666d06d8230fe3d89b922c45d36a47d (diff) |
Move ChatOps migrations to Core
Diffstat (limited to 'db/migrate/20180209115333_create_chatops_tables.rb')
-rw-r--r-- | db/migrate/20180209115333_create_chatops_tables.rb | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/db/migrate/20180209115333_create_chatops_tables.rb b/db/migrate/20180209115333_create_chatops_tables.rb new file mode 100644 index 00000000000..2cfb71e1007 --- /dev/null +++ b/db/migrate/20180209115333_create_chatops_tables.rb @@ -0,0 +1,26 @@ +# frozen_string_literal: true + +class CreateChatopsTables < ActiveRecord::Migration[4.2] + include Gitlab::Database::MigrationHelpers + + DOWNTIME = false + + def change + create_table :ci_pipeline_chat_data, id: :bigserial do |t| + t.integer :pipeline_id, null: false + t.references :chat_name, foreign_key: { on_delete: :cascade }, null: false + t.text :response_url, null: false + + # A pipeline can only contain one row in this table, hence this index is + # unique. + t.index :pipeline_id, unique: true + + t.index :chat_name_id + end + + # rubocop:disable Migration/AddConcurrentForeignKey + add_foreign_key :ci_pipeline_chat_data, :ci_pipelines, + column: :pipeline_id, + on_delete: :cascade + end +end |