Postgres.
This commit is contained in:
parent
695644c260
commit
806f42e3f8
25 changed files with 501 additions and 294 deletions
17
models/transaction.js
Normal file
17
models/transaction.js
Normal file
|
@ -0,0 +1,17 @@
|
|||
export default function (sequelize, DataTypes) {
|
||||
const Transaction = sequelize.define('transaction', {
|
||||
uuid: { type: DataTypes.UUID, defaultValue: DataTypes.UUIDV4 },
|
||||
amount: DataTypes.DECIMAL,
|
||||
description: DataTypes.STRING,
|
||||
type: DataTypes.ENUM('direct', 'paypal'), // eslint-disable-line new-cap
|
||||
ip: 'inet',
|
||||
}, {
|
||||
classMethods: {
|
||||
associate: (models) => {
|
||||
Transaction.belongsTo(models.user);
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
return Transaction;
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue