32 lines
637 B
JavaScript
32 lines
637 B
JavaScript
const { DataTypes } = require('sequelize');
|
|
const sequelize = require('./db');
|
|
|
|
const Sponsor = sequelize.define('Sponsor', {
|
|
id: {
|
|
type: DataTypes.INTEGER,
|
|
primaryKey: true,
|
|
autoIncrement: true
|
|
},
|
|
activityId: {
|
|
type: DataTypes.INTEGER,
|
|
allowNull: false
|
|
},
|
|
name: {
|
|
type: DataTypes.STRING,
|
|
allowNull: false
|
|
},
|
|
logo: DataTypes.STRING,
|
|
type: {
|
|
type: DataTypes.ENUM('title', 'sponsor'),
|
|
defaultValue: 'sponsor'
|
|
},
|
|
link: DataTypes.STRING,
|
|
sortOrder: {
|
|
type: DataTypes.INTEGER,
|
|
defaultValue: 0,
|
|
comment: '排序值,数字越小越靠前'
|
|
}
|
|
});
|
|
|
|
module.exports = Sponsor;
|