Commit af7cd095 authored by allison.browne's avatar allison.browne

Use t.references to generate foreign key column

Use t.references to generate foreign key column and constraint
on zoom_meetings table.
parent b3a1d7b3
......@@ -9,15 +9,14 @@ class CreateZoomMeetings < ActiveRecord::Migration[5.2]
def change
create_table :zoom_meetings do |t|
t.integer :project_id, null: false, index: true
t.integer :issue_id, null: false, index: true
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.foreign_key :projects, on_delete: :cascade
t.foreign_key :issues, on_delete: :cascade
t.index [:issue_id, :issue_status], unique: true,
where: "issue_status = #{ZOOM_MEETING_STATUS_ADDED}"
end
......
......@@ -3898,8 +3898,8 @@ ActiveRecord::Schema.define(version: 2019_10_04_133612) do
end
create_table "zoom_meetings", force: :cascade do |t|
t.integer "project_id", null: false
t.integer "issue_id", null: false
t.bigint "project_id", null: false
t.bigint "issue_id", null: false
t.datetime_with_timezone "created_at", null: false
t.datetime_with_timezone "updated_at", null: false
t.integer "issue_status", limit: 2, default: 1, null: false
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment