Add basic functionality
This commit is contained in:
@@ -2,6 +2,8 @@ class CreatePeople < ActiveRecord::Migration[7.0]
|
||||
def change
|
||||
create_table :people do |t|
|
||||
t.string :name, null: false
|
||||
t.date :birth_day, null: false
|
||||
t.references :birth_country, null: false, foreign_key: { to_table: :countries }
|
||||
|
||||
t.timestamps
|
||||
end
|
||||
|
||||
@@ -3,6 +3,8 @@ class CreateAdmissions < ActiveRecord::Migration[7.0]
|
||||
create_table :admissions do |t|
|
||||
t.references :country, null: false, foreign_key: true
|
||||
t.references :person, null: false, foreign_key: true
|
||||
t.references :previous, null: true, foreign_key: { to_table: :admissions }
|
||||
|
||||
t.date :arrived_on, null: false
|
||||
|
||||
t.timestamps
|
||||
|
||||
Reference in New Issue
Block a user