mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-01-21 15:14:14 +08:00
14 lines
357 B
Ruby
14 lines
357 B
Ruby
|
# frozen_string_literal: true
|
||
|
|
||
|
class AddCounterCacheRepositoryRow < ActiveRecord::Migration[7.0]
|
||
|
def change
|
||
|
change_table :repositories, bulk: true do |t|
|
||
|
t.integer :repository_rows_count, default: 0, null: false
|
||
|
end
|
||
|
|
||
|
Repository.find_each do |repository|
|
||
|
Repository.reset_counters(repository.id, :repository_rows)
|
||
|
end
|
||
|
end
|
||
|
end
|