ms_coupons.ts 1.6 KB
/* jshint indent: 2 */

module.exports = function(sequelize:any, DataTypes:any) {
    return sequelize.define('ms_coupons', {
      id: {
        type: DataTypes.INTEGER(11),
        allowNull: false,
        primaryKey: true,
        autoIncrement: true
      },
      name: {
        type: DataTypes.STRING(50),
        allowNull: false,
        unique: true
      },
      user_id: {
        type: DataTypes.INTEGER(11),
        allowNull: true
      },
      type: {
        type: DataTypes.INTEGER(11),
        allowNull: true
      },
      args: {
        type: DataTypes.JSON,
        allowNull: true
      },
      start_time: {
        type: DataTypes.DATE,
        allowNull: true
      },
      end_time: {
        type: DataTypes.DATE,
        allowNull: true
      },
      use_id:{
        type: DataTypes.INTEGER(11),
        allowNull: true
      },
      use_code: {
        type: DataTypes.STRING(500),
        allowNull: true
      },
      operator_id:{
        type: DataTypes.INTEGER(11),
        allowNull: true
      },
      created_at: {
        type: DataTypes.DATE,
        allowNull: true
      },
      updated_at: {
        type: DataTypes.DATE,
        allowNull: true
      },
      deleted_at: {
        type: DataTypes.DATE,
        allowNull: true
      },
      where: {
        type: DataTypes.JSON,
        allowNull: true
      },
      memo: {
        type: DataTypes.STRING(500),
        allowNull: true
      },
      platform: {
        type: DataTypes.STRING(30),
        allowNull: true 
      }
    }, {
      tableName: 'ms_coupons'
    });
  };