Files
yourpart3/backend/models/taxi/taxiMapTile.js
Torsten Schulz (local) 1ab9407e79
All checks were successful
Deploy to production / deploy (push) Successful in 2m56s
Refactor code structure for improved readability and maintainability; optimize performance across multiple modules.
2026-07-21 09:08:15 +02:00

52 lines
1006 B
JavaScript
Executable File

import { DataTypes } from 'sequelize';
import { sequelize } from '../../utils/sequelize.js';
const TaxiMapTile = sequelize.define('TaxiMapTile', {
id: {
type: DataTypes.INTEGER,
primaryKey: true,
autoIncrement: true,
},
mapId: {
type: DataTypes.INTEGER,
allowNull: false,
},
x: {
type: DataTypes.INTEGER,
allowNull: false,
},
y: {
type: DataTypes.INTEGER,
allowNull: false,
},
tileType: {
type: DataTypes.STRING(50),
allowNull: false,
},
trafficLight: {
type: DataTypes.BOOLEAN,
allowNull: false,
defaultValue: false,
comment: 'Whether this tile has a traffic light'
},
meta: {
type: DataTypes.JSON,
allowNull: true,
}
}, {
tableName: 'taxi_map_tile',
schema: 'taxi',
timestamps: true,
underscored: true,
indexes: [
{ unique: true, fields: ['map_id','x','y'] },
{ fields: ['map_id'] },
{ fields: ['tile_type'] },
{ fields: ['traffic_light'] },
]
});
export default TaxiMapTile;