Retrospring/db/migrate/20141130130221_create_relat...

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

17 lines
383 B
Ruby
Raw Normal View History

2023-10-19 16:37:34 -07:00
# frozen_string_literal: true
class CreateRelationships < ActiveRecord::Migration[4.2]
2014-11-30 05:06:05 -08:00
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
2023-10-19 16:37:34 -07:00
add_index :relationships, %i[source_id target_id], unique: true
2014-11-30 05:06:05 -08:00
end
end