updates

NOTES

  • after the deployment, we need to run latest migrations (0031_recreate_subscriber_sources_activities.py) to perform changes in the subscriber_sources_activities table
  • migration will rename table to _old and create a new one with the new schema
  • data then should be migrated (clickhouse-migrations)

SQL statement to obtain a list of inserts for each partition in a context of new schema changes:

select concat('insert into subscriber_sources_activities (datetime, key, value, channel_id, firebase_id, sender_id, sent_count, delivered_count, clicked_count, closed_count, subscribed_count, unsubscribed_count, page_view_count, subscribed_date) select datetime, key, value, channel_id, 0 as firebase_id, 0 as sender_id, sent_count, delivered_count, clicked_count, closed_count, subscribed_count, unsubscribed_count, page_view_count, toDate(0) as subscribed_date from subscriber_sources_activities_tmp where toYYYYMM(datetime)=',partition) as cmd, 
database, table, partition, sum(rows), sum(bytes_on_disk), count()
from system.parts
where database='statistics' and table='subscriber_sources_activities_tmp'
group by database, table, partition
order by partition
deployment render all [[templates/items/deployment]] where page = @page.name