2015-12-11 19:23:41 +00:00
|
|
|
class Messages < ActiveRecord::Migration
|
|
|
|
def change
|
2016-07-26 00:14:23 +00:00
|
|
|
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
|