-
Notifications
You must be signed in to change notification settings - Fork 42
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: use task to reset ckb_hodl_wave (#1626)
Signed-off-by: Miles Zhang <[email protected]>
- Loading branch information
1 parent
8bb8267
commit b076be9
Showing
2 changed files
with
12 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
namespace :migration do | ||
desc "Usage: RAILS_ENV=production bundle exec rake 'migration:reset_daily_statistic_attribute[ckb_hodl_wave]'" | ||
task :reset_daily_statistic_attribute, [:attribute] => :environment do |_, args| | ||
attribute = args[:attribute] | ||
DailyStatistic.where(attribute => nil).order("id asc").each do |ds| | ||
puts ds.created_at_unixtimestamp | ||
ds.reset_one!(attribute.to_sym) | ||
end | ||
puts "done" | ||
end | ||
end |