1
0
mirror of https://github.com/fspc/BikeShed-1.git synced 2025-03-01 01:03:23 -05:00
BikeShed-1/db/migrate/20121204220660_acts_as_loggable_migration.rb

26 lines
562 B
Ruby
Raw Normal View History

2012-12-04 17:08:18 -05:00
class ActsAsLoggableMigration < ActiveRecord::Migration
def self.up
create_table :logs do |t|
t.references :loggable, :polymorphic => true
t.references :logger, :polymorphic => true
t.string :context, :limit => 128
t.datetime "start_date", :null => false
t.datetime "end_date", :null => false
t.text :description, :default => ""
t.integer :action_id, :default => 0
t.timestamps
end
add_index :logs, [:loggable_id, :loggable_type, :context]
end
def self.down
drop_table :logs
end
end