mirror of
https://github.com/Retrospring/retrospring.git
synced 2024-11-20 10:39:54 +01:00
16 lines
383 B
Ruby
16 lines
383 B
Ruby
# frozen_string_literal: true
|
|
|
|
class CreateRelationships < ActiveRecord::Migration[4.2]
|
|
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, %i[source_id target_id], unique: true
|
|
end
|
|
end
|