Newer
Older
import {
Entity,
Column,
PrimaryGeneratedColumn,
ManyToOne,
Timestamp,
} from 'typeorm';
import { Game_PersonEntity, GameEntity } from '../game/game.entity';
import { FactionEntity } from '../faction/faction.entity';
@Entity('MapDrawing')
export class MapDrawingEntity {
@PrimaryGeneratedColumn('uuid') mapDrawingId: string;
@Column({ type: 'bool', nullable: true }) drawingIsActive: boolean;
@Column({ type: 'time', nullable: true }) drawingValidTill: string;
@ManyToOne(type => FactionEntity, faction => faction.mapDrawings, {
onDelete: 'CASCADE',
})
@ManyToOne(type => GameEntity, gameEntity => gameEntity.id, {
onDelete: 'CASCADE',
})
@Entity('Game_Person_MapDrawing')
export class Game_Person_MapDrawingEntity {
@PrimaryGeneratedColumn('uuid') GPmapDrawingId: string;
@Column({ type: 'timestamp' }) GPCTimeStamp: Timestamp;
@ManyToOne(
type => Game_PersonEntity,
game_person => game_person.gamepersonId,
{
onDelete: 'CASCADE',
},
)
@ManyToOne(
type => MapDrawingEntity,
map_drawing => map_drawing.mapDrawingId,
{
onDelete: 'CASCADE',
},
)