Add parks_by_state model
This commit is contained in:
14
db/migrate/20251008150542_create_parks_by_states.rb
Normal file
14
db/migrate/20251008150542_create_parks_by_states.rb
Normal 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
|
||||
Reference in New Issue
Block a user