gitlab-org--gitlab-foss/db/migrate/20170120131253_create_chat_...

20 lines
473 B
Ruby
Raw Normal View History

# rubocop:disable Migration/Timestamps
2017-02-02 14:04:02 +00:00
class CreateChatTeams < ActiveRecord::Migration
include Gitlab::Database::MigrationHelpers
2017-02-24 12:25:42 +00:00
DOWNTIME = true
DOWNTIME_REASON = "Adding a foreign key"
2017-02-02 14:04:02 +00:00
2017-03-01 19:34:29 +00:00
disable_ddl_transaction!
2017-02-02 14:04:02 +00:00
def change
create_table :chat_teams do |t|
2017-03-06 07:55:30 +00:00
t.references :namespace, null: false, index: { unique: true }, foreign_key: { on_delete: :cascade }
2017-02-02 14:04:02 +00:00
t.string :team_id
t.string :name
t.timestamps null: false
end
end
end