Sha256: 53fa4a32345de60cbddbb55ce0e117bc072b21d7e606e6520b5f4b52052c0a28
Contents?: true
Size: 506 Bytes
Versions: 2
Compression:
Stored size: 506 Bytes
Contents
class Viewings < ActiveRecord::Migration def self.up create_table :viewings do |t| t.column :viewer_id, :integer t.column :viewed_id, :integer t.column :viewed_type, :string t.column :ip, :string, :limit => '24' t.column :created_at, :datetime end add_index :viewings, [:viewer_id], :name => "index_viewings" add_index :viewings, [:viewed_type, :viewed_id], :name => "index_viewings_viewed" end def self.down drop_table :viewings end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
santey_view-0.2.0 | lib/generators/templates/migrations/viewings.rb |
santey_view-0.1.0 | lib/generators/templates/migrations/viewings.rb |