Skip to content
Snippets Groups Projects

Commenting to Development

Merged Ghost User requested to merge Commenting into Development
29 files
+ 172
192
Compare changes
  • Side-by-side
  • Inline
Files
29
@@ -9,12 +9,18 @@ import {
import { GameEntity } from '../game/game.entity';
import { FactionEntity } from '../faction/faction.entity';
//////////////////////////////////////////////////////////////////////
/// Entities for different drawings in game and their histories ///
//////////////////////////////////////////////////////////////////////
@Entity('MapDrawing')
export class MapDrawingEntity {
@PrimaryGeneratedColumn('uuid') mapDrawingId: string;
@Column({ type: 'bool', nullable: true }) drawingIsActive: boolean;
@Column({ type: 'json', nullable: true }) data: JSON;
// When Faction or game that has the drawing in question is deleted from
// the database, the drawing is also deleted
@ManyToOne(type => FactionEntity, faction => faction.mapDrawings, {
onDelete: 'CASCADE',
})
@@ -42,6 +48,7 @@ export class MapDrawingHistoryEntity {
@Column('bool') drawingIsActive: boolean;
@Column('json') data: JSON;
// If drawing is deleted, it's histories are deleted also
@ManyToOne(() => MapDrawingEntity, mapDrawing => mapDrawing.mapDrawingId, {
onDelete: 'CASCADE',
})
Loading