reports.js 837 Bytes
/**
 * Created by Tommy Huang on 18/04/17.
 */

const sequelize = require('./db').db
const Sequelize = require('sequelize')

const Report = sequelize.define('report', {
  id: {
    type: Sequelize.INTEGER,
    autoIncrement: true,
    primaryKey: true
  },
  borrowListId: {
    type: Sequelize.STRING,
    field: 'borrow_list_id',
    allowNull: false,
  },
  kind: {
    type: Sequelize.STRING,
    allowNull: false
  },
  content: {
    type: Sequelize.TEXT,
    allowNull: true
  },
  imgs: {
    type: Sequelize.TEXT,
    allowNull: true
  },
  status: {
    type: Sequelize.STRING,
    allowNull: false,
    defaultValue: '已提交'
  },
  userId: {
    type: Sequelize.STRING,
    field: 'user_id',
    allowNull: false,
  }
}, {
  timestamp: true,
  createdAt: 'created_at',
  updatedAt: 'updated_at',
})
module.exports = Report