Initial commit

This commit is contained in:
2023-09-24 09:43:06 +00:00
commit 4def3ac97f
75 changed files with 1409 additions and 0 deletions
@@ -0,0 +1,15 @@
class CreateCountries < ActiveRecord::Migration[7.0]
def change
create_table :countries do |t|
t.string :name, null: false
t.string :iso2, limit: 2, null: false
t.string :iso3, limit: 3, null: false
t.timestamps
end
add_index :countries, :name, unique: true
add_index :countries, :iso2, unique: true
add_index :countries, :iso3, unique: true
end
end
@@ -0,0 +1,9 @@
class CreatePeople < ActiveRecord::Migration[7.0]
def change
create_table :people do |t|
t.string :name, null: false
t.timestamps
end
end
end
@@ -0,0 +1,11 @@
class CreateAdmissions < ActiveRecord::Migration[7.0]
def change
create_table :admissions do |t|
t.references :country, null: false, foreign_key: true
t.references :person, null: false, foreign_key: true
t.date :arrived_on, null: false
t.timestamps
end
end
end