Skip to content
Snippets Groups Projects
Commit bb4e64f9 authored by Ronnie Friman's avatar Ronnie Friman
Browse files

remove relation to mapdrawing, add relation to history, add data column

parent 005c9972
No related branches found
No related tags found
3 merge requests!59Development to master,!58Development to testing,!55Flagbox replay
......@@ -83,16 +83,21 @@ export class ObjectivePointEntity {
@PrimaryGeneratedColumn('uuid') objectivePointId: string;
@Column({ type: 'text' }) objectivePointDescription: string;
@Column({ type: 'float' }) objectivePointMultiplier: number;
@Column({ type: 'json' }) data: JSON;
// If the MapDrawing or Game where the ObjectivePoint was in is deleted, the ObjectivePoint is also deleted
@ManyToOne(type => MapDrawingEntity, coordinate => coordinate.data, {
onDelete: 'CASCADE',
})
coordinate: MapDrawingEntity;
// If the Game where the ObjectivePoint was in is deleted, the ObjectivePoint is also deleted
@ManyToOne(type => GameEntity, game => game.objective_points, {
onDelete: 'CASCADE',
})
game: GameEntity;
@OneToMany(
() => ObjectivePoint_HistoryEntity,
history => history.objective_point,
{
onDelete: 'NO ACTION',
},
)
history: ObjectivePoint_HistoryEntity[];
}
@Entity('ObjectivePoint_History')
......@@ -101,7 +106,7 @@ export class ObjectivePoint_HistoryEntity {
@Column({ type: 'timestamp' }) oP_HistoryTimestamp: Timestamp;
@Column('float') action: number;
// If the owner Faction, capturer Faction or ObjectivePoint, that has, is trying to have or is the point where
// If the owner Faction, capturer Faction or ObjectivePoint, that has, is trying to have or is the point where
// ObjectivePointHistory points to is deleted, the ObjectivePointHistory is also deleted
@ManyToOne(type => FactionEntity, factionEntity => factionEntity.factionId, {
onDelete: 'CASCADE',
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment