Add basic functionality

This commit is contained in:
Bogdan Bagno
2024-09-16 02:10:08 +01:00
parent 4def3ac97f
commit 8630218c41
16 changed files with 130 additions and 2 deletions
@@ -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