Refactor multiple models to remove foreign key references while maintaining required fields, enhancing data integrity and simplifying model definitions.

This commit is contained in:
Torsten Schulz (local)
2025-12-18 16:08:30 +01:00
parent c66fbf1a62
commit c8072b8052
24 changed files with 38 additions and 222 deletions

View File

@@ -9,14 +9,7 @@ const TaxiHighscore = sequelize.define('TaxiHighscore', {
},
userId: {
type: DataTypes.INTEGER,
allowNull: true, // Kann null sein, falls User gelöscht wird
references: {
model: {
tableName: 'user',
schema: 'community'
},
key: 'id'
}
allowNull: true // Kann null sein, falls User gelöscht wird
},
nickname: {
type: DataTypes.STRING(100),
@@ -44,13 +37,6 @@ const TaxiHighscore = sequelize.define('TaxiHighscore', {
mapId: {
type: DataTypes.INTEGER,
allowNull: true,
references: {
model: {
tableName: 'taxi_map',
schema: 'taxi'
},
key: 'id'
},
comment: 'ID der gespielten Map'
},
mapName: {