2011-10-13 16:55:03 +01:00
|
|
|
class CreateRelations < ActiveRecord::Migration
|
|
|
|
def self.up
|
|
|
|
create_table :relations do |t|
|
2014-08-20 21:49:26 +01:00
|
|
|
t.integer :object_id, references: nil
|
2011-10-13 16:55:03 +01:00
|
|
|
t.string :object_type
|
2014-08-20 21:49:26 +01:00
|
|
|
t.integer :target_id, references: nil
|
2011-10-13 16:55:03 +01:00
|
|
|
t.string :target_type
|
|
|
|
|
|
|
|
t.timestamps
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
def self.down
|
|
|
|
drop_table :relations
|
|
|
|
end
|
|
|
|
end
|