You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
57 lines
1.0 KiB
JavaScript
57 lines
1.0 KiB
JavaScript
const Sequelize = require('sequelize');
|
|
module.exports = function(sequelize, DataTypes) {
|
|
return sequelize.define('city', {
|
|
sn: {
|
|
autoIncrement: true,
|
|
type: DataTypes.INTEGER,
|
|
allowNull: false,
|
|
primaryKey: true
|
|
},
|
|
id: {
|
|
type: DataTypes.STRING(10),
|
|
allowNull: true
|
|
},
|
|
name: {
|
|
type: DataTypes.STRING(100),
|
|
allowNull: true
|
|
},
|
|
latitude: {
|
|
type: DataTypes.DOUBLE,
|
|
allowNull: true
|
|
},
|
|
longitude: {
|
|
type: DataTypes.DOUBLE,
|
|
allowNull: true
|
|
},
|
|
lgc: {
|
|
type: DataTypes.TINYINT,
|
|
allowNull: false
|
|
},
|
|
locale: {
|
|
type: DataTypes.STRING(100),
|
|
allowNull: true
|
|
}
|
|
}, {
|
|
sequelize,
|
|
tableName: 'city',
|
|
timestamps: false,
|
|
indexes: [
|
|
{
|
|
name: "PRIMARY",
|
|
unique: true,
|
|
using: "BTREE",
|
|
fields: [
|
|
{ name: "sn" },
|
|
]
|
|
},
|
|
{
|
|
name: "city_id_IDX",
|
|
using: "BTREE",
|
|
fields: [
|
|
{ name: "id" },
|
|
]
|
|
},
|
|
]
|
|
});
|
|
};
|