1
0
Fork 0
This repository has been archived on 2023-03-27. You can view files and clone it, but cannot push or open issues or pull requests.
lpr-partynest/db/migrate/20190427141639_create_relationships.rb

22 lines
593 B
Ruby
Raw Normal View History

2019-04-27 10:24:04 -04:00
# frozen_string_literal: true
class CreateRelationships < ActiveRecord::Migration[6.0]
def change
create_table :relationships do |t|
t.timestamps null: false
2019-04-28 09:24:01 -04:00
t.references :person, null: false, index: false
2019-04-28 08:48:51 -04:00
t.references :regional_office, null: false, index: true, foreign_key: true
2019-04-28 09:24:01 -04:00
t.integer :number, null: false
t.index %i[person_id number], unique: true
t.foreign_key :people
2019-04-28 08:48:51 -04:00
t.date :supporter_since, index: true, null: false
t.date :member_since, index: true
t.date :excluded_since, index: true
2019-04-27 10:24:04 -04:00
end
end
end