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

25 lines
731 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
2020-05-24 23:13:21 +05:30
t.string :url, limit: 255 # rubocop:disable Migration/PreventStrings
2019-12-26 22:10:19 +05:30
t.index [:issue_id, :issue_status], unique: true,
where: "issue_status = #{ZOOM_MEETING_STATUS_ADDED}"
end
end
end