5
0
Fork 0
mirror of https://0xacab.org/sutty/sutty synced 2024-11-19 07:36:22 +00:00

Merge branch 'issue-13780' of https://0xacab.org/sutty/sutty into 17.3.alpine.panel.sutty.nl

This commit is contained in:
Sutty 2023-09-27 19:32:18 +00:00
commit aef2cd56e6

View file

@ -2,7 +2,17 @@
# Almacenar el último commit indexado
class AddLastIndexedCommitToSites < ActiveRecord::Migration[6.1]
def change
def up
add_column :sites, :last_indexed_commit, :string, null: true
Site.find_each do |site|
site.update_columns(last_indexed_commit: site.repository.head_commit.oid)
rescue Rugged::Error, Rugged::OSError => e
puts "Falló #{site.name}, ignorando: #{e.message}"
end
end
def down
remove_column :sites, :last_indexed_commit
end
end