feat: add notification data model and migration
This commit is contained in:
@@ -0,0 +1,23 @@
|
||||
import { Column, Entity, Index, ManyToOne, PrimaryGeneratedColumn } from 'typeorm';
|
||||
import { EntityHelper } from 'src/utils/entity-helper';
|
||||
import { Notification } from './notification.entity';
|
||||
|
||||
@Entity()
|
||||
export class NotificationRecipient extends EntityHelper {
|
||||
@PrimaryGeneratedColumn()
|
||||
id: number;
|
||||
|
||||
@Index('IDX_notification_recipient_notification_id')
|
||||
@ManyToOne(() => Notification, { onDelete: 'CASCADE' })
|
||||
notification: Notification;
|
||||
|
||||
@Index('IDX_notification_recipient_user_id')
|
||||
@Column()
|
||||
userId: number;
|
||||
|
||||
@Column({ default: false })
|
||||
read: boolean;
|
||||
|
||||
@Column({ nullable: true })
|
||||
readAt: Date | null;
|
||||
}
|
||||
Reference in New Issue
Block a user