Update migration and version

This commit is contained in:
Eugene Burmakin 2025-12-30 16:57:00 +01:00
parent 5455228b80
commit 2f5487cd35
5 changed files with 17 additions and 11 deletions

View file

@ -1 +1 @@
0.36.5 0.37.0

View file

@ -4,7 +4,7 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](http://keepachangelog.com/) The format is based on [Keep a Changelog](http://keepachangelog.com/)
and this project adheres to [Semantic Versioning](http://semver.org/). and this project adheres to [Semantic Versioning](http://semver.org/).
# [0.36.5] - Unreleased # [0.37.0] - 2025-12-30
## Added ## Added

View file

@ -168,7 +168,7 @@
<div class="content"> <div class="content">
<p> <p>
Hi, this is Evgenii from Dawarich! Pretty wild journey last yeah, huh? Let's take a look back at all the places you explored in <strong><%= @digest.year %></strong>. Hi, this is Evgenii from Dawarich! Pretty wild journey last year, huh? Let's take a look back at all the places you explored in <strong><%= @digest.year %></strong>.
</p> </p>
</div> </div>

View file

@ -27,15 +27,19 @@ class AddCompositeIndexToStats < ActiveRecord::Migration[8.0]
deleted_count = 0 deleted_count = 0
loop do loop do
batch_deleted = execute(<<-SQL.squish).cmd_tuples batch_deleted = execute(<<-SQL.squish).cmd_tuples
DELETE FROM stats s1 DELETE FROM stats
WHERE EXISTS ( WHERE id IN (
SELECT 1 FROM stats s2 SELECT s1.id
WHERE s2.user_id = s1.user_id FROM stats s1
AND s2.year = s1.year WHERE EXISTS (
AND s2.month = s1.month SELECT 1 FROM stats s2
AND s2.id > s1.id WHERE s2.user_id = s1.user_id
AND s2.year = s1.year
AND s2.month = s1.month
AND s2.id > s1.id
)
LIMIT #{BATCH_SIZE}
) )
LIMIT #{BATCH_SIZE}
SQL SQL
break if batch_deleted.zero? break if batch_deleted.zero?

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
class AddVerifiedAtToPointsRawDataArchives < ActiveRecord::Migration[8.0] class AddVerifiedAtToPointsRawDataArchives < ActiveRecord::Migration[8.0]
def change def change
add_column :points_raw_data_archives, :verified_at, :datetime add_column :points_raw_data_archives, :verified_at, :datetime