Class: CreateDurations

Inherits:
ActiveRecord::Migration
  • Object
show all
Defined in:
lib/watch_tower/server/db/migrate/004_create_durations.rb

Instance Method Summary collapse

Instance Method Details

#changeObject



4
5
6
7
8
9
10
11
12
13
14
15
# File 'lib/watch_tower/server/db/migrate/004_create_durations.rb', line 4

def change
  create_table :durations do |t|
    t.references :file, null: false
    t.date :date, null: false
    t.integer :duration, default: 0

    t.timestamps
  end

  add_index :durations, :file_id
  add_index :durations, :date
end