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.
84 lines
1.6 KiB
JavaScript
84 lines
1.6 KiB
JavaScript
10 months ago
|
const Sequelize = require('sequelize');
|
||
|
module.exports = function(sequelize, DataTypes) {
|
||
|
return sequelize.define('images', {
|
||
|
sn: {
|
||
|
autoIncrement: true,
|
||
|
type: DataTypes.BIGINT,
|
||
|
allowNull: false,
|
||
|
primaryKey: true
|
||
|
},
|
||
|
hotel_id: {
|
||
|
type: DataTypes.BIGINT,
|
||
|
allowNull: false
|
||
|
},
|
||
|
info_source: {
|
||
|
type: DataTypes.STRING(100),
|
||
|
allowNull: true
|
||
|
},
|
||
|
info_source_id: {
|
||
|
type: DataTypes.STRING(100),
|
||
|
allowNull: true
|
||
|
},
|
||
|
type: {
|
||
|
type: DataTypes.STRING(100),
|
||
|
allowNull: true,
|
||
|
comment: "Mid小图; Max大图;"
|
||
|
},
|
||
|
url: {
|
||
|
type: DataTypes.STRING(1000),
|
||
|
allowNull: true
|
||
|
},
|
||
|
caption: {
|
||
|
type: DataTypes.STRING(1000),
|
||
|
allowNull: true
|
||
|
},
|
||
|
category: {
|
||
|
type: DataTypes.STRING(100),
|
||
|
allowNull: true
|
||
|
},
|
||
|
lgc: {
|
||
|
type: DataTypes.TINYINT,
|
||
|
allowNull: false
|
||
|
},
|
||
|
locale: {
|
||
|
type: DataTypes.STRING(100),
|
||
|
allowNull: true
|
||
|
}
|
||
|
}, {
|
||
|
sequelize,
|
||
|
tableName: 'images',
|
||
|
timestamps: false,
|
||
|
indexes: [
|
||
|
{
|
||
|
name: "PRIMARY",
|
||
|
unique: true,
|
||
|
using: "BTREE",
|
||
|
fields: [
|
||
|
{ name: "sn" },
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
name: "image_urls_hotel_id_IDX",
|
||
|
using: "BTREE",
|
||
|
fields: [
|
||
|
{ name: "hotel_id" },
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
name: "image_urls_source_id_IDX",
|
||
|
using: "BTREE",
|
||
|
fields: [
|
||
|
{ name: "info_source_id" },
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
name: "images_lgc_IDX",
|
||
|
using: "BTREE",
|
||
|
fields: [
|
||
|
{ name: "lgc" },
|
||
|
]
|
||
|
},
|
||
|
]
|
||
|
});
|
||
|
};
|