'use strict'
/**
 * 电子签订单关联产品表
 */
module.exports = function (db, DataTypes) {
    return db.define('eorderproduct', {
            order_id: {type: DataTypes.STRING, field: 'order_id', allowNull: true, defaultValue:'',comment:'订单号' },
            product_id: {type: DataTypes.STRING, field: 'product_id', allowNull: true,defaultValue:'', comment:'产品id'},
            price: { type: DataTypes.BIGINT, field: 'price', allowNull: true, defaultValue:0,comment:'订单价格'},
            product_name: {type: DataTypes.STRING, field: 'product_name', allowNull: true,defaultValue:'', comment:'产品名称'},
            product_property: {type: DataTypes.INTEGER, field: 'product_property', allowNull: true,defaultValue:0, comment:'产品属性 1认证 2签约'},
            created_at: { type: DataTypes.DATE, field: 'created_at', allowNull: false},
            updated_at: { type: DataTypes.DATE, field: 'updated_at', allowNull: false},
            deleted_at: { type: DataTypes.DATE, field: 'deleted_at', allowNull: true },
            version: { type: DataTypes.BIGINT, field: 'version', defalut:0,allowNull: true }
        },
        {
            paranoid: true, //假的删除
            underscored: true,
            version: true,
            freezeTableName: true,
            tableName: 'e_order_product',
        });
}

