From 3e81913b6a161cfc8405bda64b4a00e8e3b1fccd Mon Sep 17 00:00:00 2001 From: syuilo Date: Sun, 25 Dec 2022 09:09:46 +0900 Subject: feat: introduce retention-rate aggregation --- .../src/models/entities/RetentionAggregation.ts | 35 ++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 packages/backend/src/models/entities/RetentionAggregation.ts (limited to 'packages/backend/src/models/entities') diff --git a/packages/backend/src/models/entities/RetentionAggregation.ts b/packages/backend/src/models/entities/RetentionAggregation.ts new file mode 100644 index 0000000000..c79b762d71 --- /dev/null +++ b/packages/backend/src/models/entities/RetentionAggregation.ts @@ -0,0 +1,35 @@ +import { Entity, PrimaryColumn, Index, Column } from 'typeorm'; +import { id } from '../id.js'; +import type { User } from './User.js'; + +@Entity() +export class RetentionAggregation { + @PrimaryColumn(id()) + public id: string; + + @Index() + @Column('timestamp with time zone', { + comment: 'The created date of the Note.', + }) + public createdAt: Date; + + @Column('timestamp with time zone', { + comment: 'The updated date of the GalleryPost.', + }) + public updatedAt: Date; + + @Column({ + ...id(), + array: true, + }) + public userIds: User['id'][]; + + @Column('integer', { + }) + public usersCount: number; + + @Column('jsonb', { + default: {}, + }) + public data: Record; +} -- cgit v1.3.1-freya