CreateJournalEntries.change()   A
last analyzed

Complexity

Conditions 1

Size

Total Lines 8

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
cc 1
c 1
b 0
f 1
dl 0
loc 8
rs 9.4285
1
# frozen_string_literal: true
2
3
# Table to hold patient diary entries
4
class CreateJournalEntries < ActiveRecord::Migration[5.1]
5
  def change
6
    create_table :journal_entries do |t|
7
      t.references :journal, null: false, foreign_key: true, index: true
8
      t.datetime :entry_date, null: false, index: true, default: -> { 'CURRENT_TIMESTAMP' }
9
      t.text :entry, null: false, default: ''  
10
      t.timestamps null: false, default: -> { 'CURRENT_TIMESTAMP' }
11
    end
12
  end
13
end
14