File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -45,8 +45,8 @@ export const userProfileAnalyticsClickhouseCron: Cron = {
4545 uniqMerge(unique_visitors) AS "uniqueVisitors"
4646 FROM api.user_profile_analytics
4747 FINAL
48- WHERE user_id IN (
49- SELECT DISTINCT user_id
48+ WHERE profile_id IN (
49+ SELECT DISTINCT profile_id
5050 FROM api.user_profile_analytics
5151 WHERE created_at > {lastRunAt: DateTime}
5252 )
Original file line number Diff line number Diff line change @@ -24,29 +24,9 @@ export class UserProfileAnalytics1768505964487 implements MigrationInterface {
2424 CONSTRAINT "PK_user_profile_analytics_history" PRIMARY KEY ("id", "date")
2525 )` ,
2626 ) ;
27-
28- await queryRunner . query (
29- `ALTER TABLE "user_profile_analytics"
30- ADD CONSTRAINT "FK_user_profile_analytics_user"
31- FOREIGN KEY ("id") REFERENCES "user"("id")
32- ON DELETE CASCADE ON UPDATE NO ACTION` ,
33- ) ;
34-
35- await queryRunner . query (
36- `ALTER TABLE "user_profile_analytics_history"
37- ADD CONSTRAINT "FK_user_profile_analytics_history_user"
38- FOREIGN KEY ("id") REFERENCES "user"("id")
39- ON DELETE CASCADE ON UPDATE NO ACTION` ,
40- ) ;
4127 }
4228
4329 public async down ( queryRunner : QueryRunner ) : Promise < void > {
44- await queryRunner . query (
45- `ALTER TABLE "user_profile_analytics_history" DROP CONSTRAINT "FK_user_profile_analytics_history_user"` ,
46- ) ;
47- await queryRunner . query (
48- `ALTER TABLE "user_profile_analytics" DROP CONSTRAINT "FK_user_profile_analytics_user"` ,
49- ) ;
5030 await queryRunner . query ( `DROP TABLE "user_profile_analytics_history"` ) ;
5131 await queryRunner . query ( `DROP TABLE "user_profile_analytics"` ) ;
5232 }
You can’t perform that action at this time.
0 commit comments