Files
yourpart3/backend/models/taxi/taxiMapTileHouse.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

57 lines
1.1 KiB
JavaScript
Executable File

import { DataTypes } from 'sequelize';
import { sequelize } from '../../utils/sequelize.js';
const TaxiMapTileHouse = sequelize.define('TaxiMapTileHouse', {
id: {
type: DataTypes.INTEGER,
primaryKey: true,
autoIncrement: true
},
mapId: {
type: DataTypes.INTEGER,
allowNull: false,
},
x: {
type: DataTypes.INTEGER,
allowNull: false,
comment: 'X-coordinate of the tile within the map'
},
y: {
type: DataTypes.INTEGER,
allowNull: false,
comment: 'Y-coordinate of the tile within the map'
},
corner: {
type: DataTypes.ENUM('lo', 'ro', 'lu', 'ru'),
allowNull: false,
comment: 'Corner position: lo, ro, lu, ru'
},
rotation: {
type: DataTypes.INTEGER,
allowNull: false,
defaultValue: 0,
comment: 'Rotation in degrees: 0, 90, 180, 270'
}
}, {
tableName: 'taxi_map_tile_house',
schema: 'taxi',
timestamps: true,
underscored: true,
indexes: [
{
unique: true,
fields: ['map_id', 'x', 'y', 'corner']
},
{
fields: ['map_id']
},
{
fields: ['x', 'y']
}
]
});
export default TaxiMapTileHouse;