mirror of
https://github.com/Retrospring/retrospring.git
synced 2025-01-20 03:56:04 +01:00
15 lines
348 B
Ruby
15 lines
348 B
Ruby
|
class CreateRelationships < ActiveRecord::Migration
|
||
|
def change
|
||
|
create_table :relationships do |t|
|
||
|
t.integer :source_id
|
||
|
t.integer :target_id
|
||
|
|
||
|
t.timestamps
|
||
|
end
|
||
|
|
||
|
add_index :relationships, :source_id
|
||
|
add_index :relationships, :target_id
|
||
|
add_index :relationships, [:source_id, :target_id], unique: true
|
||
|
end
|
||
|
end
|