Conditions | 1 |
Total Lines | 12 |
Lines | 12 |
Ratio | 100 % |
Changes | 0 |
1 | # frozen_string_literal: true |
||
5 | def change |
||
6 | create_table :study_event_instruments do |t| |
||
7 | t.references :study_event, null: false |
||
8 | t.references :instrument, null: false |
||
9 | t.timestamps null: false, default: -> { 'CURRENT_TIMESTAMP' } |
||
10 | end |
||
11 | |||
12 | add_index :study_event_instruments, %i[study_event_id instrument_id], \ |
||
13 | unique: true, name: 'index_by_study_event_instrument' |
||
14 | add_foreign_key :study_event_instruments, :study_events |
||
15 | add_foreign_key :study_event_instruments, :instruments |
||
16 | end |
||
17 | end |
||
18 |