The "updated" date and the sitemap lastmod came from max(created_at), so editing a datacenter, fixing an incident title or deleting an incident left them stale. Google stops trusting lastmod once it is seen to be wrong. Migration 014 adds updated_at (backfilled from created_at). Saves set it, renumbering bumps only the rows whose position actually moved, and deleting an incident bumps its datacenter. The admin delete now goes through the model so the hook runs. The sitemap gives lastmod as a full timestamp and drops changefreq, which Google ignores. Assisted-by: Claude:opus-5
13 lines
361 B
Ruby
13 lines
361 B
Ruby
Sequel.migration do
|
|
up do
|
|
# Last change to the row, for the "updated" date and sitemap lastmod.
|
|
%i[bingo_datacenters bingo_incidents].each do |t|
|
|
add_column t, :updated_at, DateTime
|
|
from(t).update(updated_at: :created_at)
|
|
end
|
|
end
|
|
|
|
down do
|
|
%i[bingo_datacenters bingo_incidents].each { |t| drop_column t, :updated_at }
|
|
end
|
|
end
|