act_wheel_surf_user.js 1008 Bytes
/* eslint new-cap: "off" */
const options = require('../model-opts');

module.exports = function(Sequelize, DataTypes) {
  let ActWheelSurfUser = Sequelize.define('ActWheelSurfUser', {
    id: {
      type: DataTypes.INTEGER(8),
      allowNull: false,
      primaryKey: true,
      autoIncrement: true
    },
    act_id: {
      type: DataTypes.INTEGER(8),
      allowNull: false
    },
    uid: {
      type: DataTypes.INTEGER(8),
      allowNull: false
    },
    prize_id: {
      type: DataTypes.INTEGER(8),
      allowNull: false
    },
    create_time: {
      type: DataTypes.DATE,
      defaultValue: Sequelize.NOW
    }
  }, Object.assign(options, {tableName: 'act_wheel_surf_user'}));

  ActWheelSurfUser.associate = ({ActWheelSurfConf, ActWheelSurfPrize}) => {
    ActWheelSurfUser.belongsTo(ActWheelSurfConf, {as: 'ActWheelSurfConf', foreignKey: 'act_id'});
    ActWheelSurfUser.belongsTo(ActWheelSurfPrize, {as: 'ActWheelSurfPrize', foreignKey: 'prize_id'});
  };
  return ActWheelSurfUser;
};