1
0
Fork 0
This repository has been archived on 2023-05-11. You can view files and clone it, but cannot push or open issues or pull requests.
lesson-decentralized_microb.../db/migrate/20210310102531_create_follo...

16 lines
461 B
Ruby
Raw Normal View History

2021-03-10 10:34:59 +00:00
class CreateFollowships < ActiveRecord::Migration[6.1]
def change
create_table :followships do |t|
t.timestamps
t.references :subject_profile,
null: false,
foreign_key: { to_table: :profiles }
t.references :object_profile,
null: false,
foreign_key: { to_table: :profiles }
t.index %i[subject_profile_id object_profile_id], unique: true
end
end
end