summaryrefslogtreecommitdiff
path: root/packages/backend/src/models/entities
diff options
context:
space:
mode:
authorsyuilo <Syuilotan@yahoo.co.jp>2022-12-25 09:09:46 +0900
committersyuilo <Syuilotan@yahoo.co.jp>2022-12-25 09:09:46 +0900
commit3e81913b6a161cfc8405bda64b4a00e8e3b1fccd (patch)
treecf96319f405f6c7723ec7d46bbe166504ded359b /packages/backend/src/models/entities
parentchore: fix reporisotry name (diff)
downloadmisskey-3e81913b6a161cfc8405bda64b4a00e8e3b1fccd.tar.gz
misskey-3e81913b6a161cfc8405bda64b4a00e8e3b1fccd.tar.bz2
misskey-3e81913b6a161cfc8405bda64b4a00e8e3b1fccd.zip
feat: introduce retention-rate aggregation
Diffstat (limited to 'packages/backend/src/models/entities')
-rw-r--r--packages/backend/src/models/entities/RetentionAggregation.ts35
1 files changed, 35 insertions, 0 deletions
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<string, number>;
+}