import { DataTypes } from 'sequelize';
import { sequelize } from '../../utils/sequelize.js';

const TaxiMapTileStreet = sequelize.define('TaxiMapTileStreet', {
  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,
  },
  streetNameHId: {
    type: DataTypes.INTEGER,
    allowNull: true,
  },
  streetNameVId: {
    type: DataTypes.INTEGER,
    allowNull: true,
  }
}, {
  tableName: 'taxi_map_tile_street',
  schema: 'taxi',
  timestamps: true,
  underscored: true,
  indexes: [
    { unique: true, fields: ['map_id','x','y'] },
    { fields: ['map_id'] },
    { fields: ['street_name_h_id'] },
    { fields: ['street_name_v_id'] }
  ]
});

export default TaxiMapTileStreet;


