forked from Ynov/ptitspas-ynov-back
notifications added
This commit is contained in:
parent
ade40bce8a
commit
3a47d86e2b
23
src/entities/notifications.entity.ts
Normal file
23
src/entities/notifications.entity.ts
Normal file
@ -0,0 +1,23 @@
|
||||
import { Column, CreateDateColumn, Entity, JoinColumn, ManyToOne, PrimaryGeneratedColumn } from "typeorm";
|
||||
import { Users } from "./users.entity";
|
||||
|
||||
@Entity('notifications')
|
||||
export class Notification {
|
||||
// Define your columns and relationships here
|
||||
@PrimaryGeneratedColumn('uuid')
|
||||
id: string;
|
||||
|
||||
@ManyToOne(() => Users, { onDelete: 'CASCADE' })
|
||||
@JoinColumn({ name: 'id_utilisateur', referencedColumnName: 'id' })
|
||||
user: Users;
|
||||
|
||||
@Column({ type: 'text', name: 'contenu' })
|
||||
content: string;
|
||||
|
||||
@Column({type: 'boolean', name: 'lu', default: false})
|
||||
read: boolean;
|
||||
|
||||
@CreateDateColumn({ name: 'cree_le', type: 'timestamptz' })
|
||||
created_at: Date;
|
||||
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user