transfer.js 795 Bytes
'use strict';

module.exports = app => {
  const { STRING, DATE, UUID, UUIDV1, TEXT, BOOLEAN } = app.Sequelize;

  const Transfer = app.model.define('transfer', {
    id: {
      allowNull: false,
      primaryKey: true,
      type: UUID,
      defaultValue: UUIDV1,
    },
    address: { type: STRING, comment: '地址' },
    // sendTrsId: { type: STRING, comment: '发送交易成功的id' },
    // toTrsId: { type: STRING, comment: '接收成功的交易id' },
    toAddress: { type: STRING, comment: '接收地址' },
    amount: { type: STRING, comment: '金额' },
    transaction: { type: TEXT, comment: '交易体' },
    finish: { type: BOOLEAN, comment: '是否完成', defaultValue: false },
    createdAt: { type: DATE },
    updatedAt: { type: DATE },
  });
  return Transfer;
};