bingo: lastmod from the last edit, not the last insert
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
This commit is contained in:
parent
b100b6a8cd
commit
6f37e537ca
5 changed files with 54 additions and 7 deletions
13
db/migrations/014_bingo_updated_at.rb
Normal file
13
db/migrations/014_bingo_updated_at.rb
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
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
|
||||
Loading…
Add table
Add a link
Reference in a new issue