metamaps--metamaps/db/migrate/20151205205831_messages.rb

16 lines
344 B
Ruby
Raw Permalink Normal View History

2015-12-11 19:23:41 +00:00
class Messages < ActiveRecord::Migration
def change
create_table :messages do |t|
2015-12-11 19:23:41 +00:00
t.text :message
t.references :user
t.integer :resource_id
t.string :resource_type
t.timestamps
end
add_index :messages, :user_id
add_index :messages, :resource_id
add_index :messages, :resource_type
end
end