Skip to content
Snippets Groups Projects
Code owners
Assign users and groups as approvers for specific file changes. Learn more.
notification.entity.ts 576 B
import {
  Entity,
  PrimaryGeneratedColumn,
  Column,
  CreateDateColumn,
  ManyToOne,
} from 'typeorm';

import { GameEntity } from '../game/game.entity';

// temporary table for warning notifications
@Entity('Notifications')
export class NotificationEntity {
  @PrimaryGeneratedColumn('uuid') id: string;
  @Column('text') type: string;
  @Column({ type: 'text' }) message: string;
  @CreateDateColumn() issued: Date;

  // Notifications are deleted if the game is deleted
  @ManyToOne(type => GameEntity, game => game.id, {
    onDelete: 'CASCADE',
  })
  game: string;
}