diff options
| author | syuilo <Syuilotan@yahoo.co.jp> | 2022-12-25 09:09:46 +0900 |
|---|---|---|
| committer | syuilo <Syuilotan@yahoo.co.jp> | 2022-12-25 09:09:46 +0900 |
| commit | 3e81913b6a161cfc8405bda64b4a00e8e3b1fccd (patch) | |
| tree | cf96319f405f6c7723ec7d46bbe166504ded359b /packages/backend/src/models/entities | |
| parent | chore: fix reporisotry name (diff) | |
| download | misskey-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.ts | 35 |
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>; +} |