summaryrefslogtreecommitdiff
path: root/packages/backend/src/models/entities/UserList.ts
diff options
context:
space:
mode:
Diffstat (limited to 'packages/backend/src/models/entities/UserList.ts')
-rw-r--r--packages/backend/src/models/entities/UserList.ts33
1 files changed, 33 insertions, 0 deletions
diff --git a/packages/backend/src/models/entities/UserList.ts b/packages/backend/src/models/entities/UserList.ts
new file mode 100644
index 0000000000..b8a4b54d4c
--- /dev/null
+++ b/packages/backend/src/models/entities/UserList.ts
@@ -0,0 +1,33 @@
+import { PrimaryColumn, Entity, Index, JoinColumn, Column, ManyToOne } from 'typeorm';
+import { id } from '../id.js';
+import { User } from './User.js';
+
+@Entity()
+export class UserList {
+ @PrimaryColumn(id())
+ public id: string;
+
+ @Column('timestamp with time zone', {
+ comment: 'The created date of the UserList.',
+ })
+ public createdAt: Date;
+
+ @Index()
+ @Column({
+ ...id(),
+ comment: 'The owner ID.',
+ })
+ public userId: User['id'];
+
+ @ManyToOne(type => User, {
+ onDelete: 'CASCADE',
+ })
+ @JoinColumn()
+ public user: User | null;
+
+ @Column('varchar', {
+ length: 128,
+ comment: 'The name of the UserList.',
+ })
+ public name: string;
+}