Skip to content
Snippets Groups Projects

Development to testing

Merged Ghost User requested to merge Development into testing
37 files
+ 503
248
Compare changes
  • Side-by-side
  • Inline
Files
37
@@ -4,17 +4,24 @@ import {
@@ -4,17 +4,24 @@ import {
PrimaryGeneratedColumn,
PrimaryGeneratedColumn,
ManyToOne,
ManyToOne,
CreateDateColumn,
CreateDateColumn,
 
OneToMany,
} from 'typeorm';
} from 'typeorm';
import { GameEntity } from '../game/game.entity';
import { GameEntity } from '../game/game.entity';
import { FactionEntity } from '../faction/faction.entity';
import { FactionEntity } from '../faction/faction.entity';
 
//////////////////////////////////////////////////////////////////////
 
/// Entities for different drawings in game and their histories ///
 
//////////////////////////////////////////////////////////////////////
 
@Entity('MapDrawing')
@Entity('MapDrawing')
export class MapDrawingEntity {
export class MapDrawingEntity {
@PrimaryGeneratedColumn('uuid') mapDrawingId: string;
@PrimaryGeneratedColumn('uuid') mapDrawingId: string;
@Column({ type: 'bool', nullable: true }) drawingIsActive: boolean;
@Column({ type: 'bool', nullable: true }) drawingIsActive: boolean;
@Column({ type: 'json', nullable: true }) data: JSON;
@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, {
@ManyToOne(type => FactionEntity, faction => faction.mapDrawings, {
onDelete: 'CASCADE',
onDelete: 'CASCADE',
})
})
@@ -38,10 +45,11 @@ export class MapDrawingEntity {
@@ -38,10 +45,11 @@ export class MapDrawingEntity {
@Entity('MapDrawingHistory')
@Entity('MapDrawingHistory')
export class MapDrawingHistoryEntity {
export class MapDrawingHistoryEntity {
@PrimaryGeneratedColumn('uuid') mapDrawingHistoryId: string;
@PrimaryGeneratedColumn('uuid') mapDrawingHistoryId: string;
@CreateDateColumn() timestamp: Date;
@Column('float') timestamp: number;
@Column('bool') drawingIsActive: boolean;
@Column('bool') drawingIsActive: boolean;
@Column('json') data: JSON;
@Column('json') data: JSON;
 
// If drawing is deleted, it's histories are deleted also
@ManyToOne(() => MapDrawingEntity, mapDrawing => mapDrawing.mapDrawingId, {
@ManyToOne(() => MapDrawingEntity, mapDrawing => mapDrawing.mapDrawingId, {
onDelete: 'CASCADE',
onDelete: 'CASCADE',
})
})
Loading