Conditions | 1 |
Total Lines | 11 |
Lines | 11 |
Ratio | 100 % |
Changes | 1 | ||
Bugs | 0 | Features | 1 |
1 | # frozen_string_literal: true |
||
5 | def change |
||
6 | create_table :study_participants do |t| |
||
7 | t.references :participant, null: false, foreign_key: true |
||
8 | t.references :study, null: false, foreign_key: true |
||
9 | t.string :subject_number, null: true |
||
10 | t.timestamps null: false, default: -> { 'CURRENT_TIMESTAMP' } |
||
11 | end |
||
12 | |||
13 | add_index :study_participants, %i[participant_id study_id], unique: true, name: 'index_participant_study' |
||
14 | add_index :study_participants, %i[study_id subject_number], name: 'index_study_subject_number' |
||
15 | end |
||
16 | end |
||
17 |