20130516032930_create_rails_admin_histories_table.rb 532 B

12345678910111213141516171819
  1. class CreateRailsAdminHistoriesTable < ActiveRecord::Migration
  2. def self.up
  3. create_table :rails_admin_histories do |t|
  4. t.text :message # title, name, or object_id
  5. t.string :username
  6. t.integer :item
  7. t.string :table
  8. t.integer :month, :limit => 2
  9. t.integer :year, :limit => 5
  10. t.timestamps
  11. end
  12. add_index(:rails_admin_histories, [:item, :table, :month, :year], :name => 'index_rails_admin_histories' )
  13. end
  14. def self.down
  15. drop_table :rails_admin_histories
  16. end
  17. end