forked from Ynov/ptitspas-ynov-back
24 lines
684 B
TypeScript
24 lines
684 B
TypeScript
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;
|
|
|
|
}
|