Add parks_by_state model

This commit is contained in:
2025-10-08 08:08:00 -07:00
parent 4806a59d96
commit 513f1334fb
4 changed files with 31 additions and 1 deletions

View File

@@ -0,0 +1,14 @@
class CreateParksByStates < ActiveRecord::Migration[8.0]
def change
create_table :parks_by_states do |t|
t.string :park_code, null: false
t.string :state, null: false
t.timestamps
end
add_index :parks_by_states, [:state, :park_code], unique: true
add_index :parks_by_states, :park_code
add_foreign_key :parks_by_states, :parks, column: :park_code, primary_key: :code
end
end