1234567891011121314151617181920212223242526272829303132333435363738 |
- /* indent size: 2 */
- module.exports = app => {
- const DataTypes = app.Sequelize;
- const Model = app.model.define('Collects', {
- collect_id: {
- type: DataTypes.INTEGER(10).UNSIGNED,
- allowNull: false,
- primaryKey: true,
- autoIncrement: true
- },
- user_id: {
- type: DataTypes.INTEGER(10).UNSIGNED,
- allowNull: true
- },
- product_id: {
- type: DataTypes.INTEGER(10).UNSIGNED,
- allowNull: true
- },
- update_time: {
- type: DataTypes.TIME
- },
- create_time: {
- type: DataTypes.DATE,
- allowNull: false
- }
- }, {
- tableName: 'szj_collects'
- });
- Model.associate = function() {
- }
- //同步:没有就新建,有就不变
- Model.sync();
- return Model;
- };
|