Add alert model
This commit is contained in:
17
db/migrate/20251008063847_create_alerts.rb
Normal file
17
db/migrate/20251008063847_create_alerts.rb
Normal 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
|
||||
Reference in New Issue
Block a user