debian-mirror-gitlab/db/migrate/20190930153535_create_zoom_meetings.rb

25 lines
688 B
Ruby
Raw Normal View History

2019-12-26 22:10:19 +05:30
# frozen_string_literal: true
class CreateZoomMeetings < ActiveRecord::Migration[5.2]
include Gitlab::Database::MigrationHelpers
DOWNTIME = false
ZOOM_MEETING_STATUS_ADDED = 1
def change
create_table :zoom_meetings do |t|
t.references :project, foreign_key: { on_delete: :cascade },
null: false
t.references :issue, foreign_key: { on_delete: :cascade },
null: false
t.timestamps_with_timezone null: false
t.integer :issue_status, limit: 2, default: 1, null: false
t.string :url, limit: 255
t.index [:issue_id, :issue_status], unique: true,
where: "issue_status = #{ZOOM_MEETING_STATUS_ADDED}"
end
end
end