Class: CreateFileViewStats

Inherits:
ActiveRecord::Migration
  • Object
show all
Defined in:
lib/generators/sufia/models/templates/migrations/create_file_view_stats.rb

Instance Method Summary collapse

Instance Method Details

#changeObject



2
3
4
5
6
7
8
9
10
11
# File 'lib/generators/sufia/models/templates/migrations/create_file_view_stats.rb', line 2

def change
  create_table :file_view_stats do |t|
    t.datetime :date
    t.integer :views
    t.string :file_id

    t.timestamps
  end
  add_index :file_view_stats, :file_id
end