Add alert model

This commit is contained in:
2025-10-08 00:07:36 -07:00
parent 7c6936b9c2
commit 6b5d069729
4 changed files with 39 additions and 1 deletions

View File

@@ -0,0 +1,17 @@
class CreateAlerts < ActiveRecord::Migration[8.0]
def change
create_table :alerts do |t|
t.string :category, null: false
t.text :description
t.string :park_code, null: false
t.string :title, null: false
t.string :url
t.timestamp :indexed_date
t.timestamps
end
add_index :alerts, :park_code
add_foreign_key :alerts, :parks, column: :park_code, primary_key: :code
end
end