making needed changes to make the table names strict
This commit is contained in:
+20
-11
@@ -2,20 +2,29 @@
|
||||
const PaymentStatus = require('./PaymentStatus');
|
||||
|
||||
module.exports = (sequelize, DataTypes) => {
|
||||
const Charge = sequelize.define('Charge', {
|
||||
id: { type: DataTypes.UUID, primaryKey: true, allowNull: false },
|
||||
description: DataTypes.STRING,
|
||||
amount: DataTypes.INTEGER,
|
||||
const Charge = sequelize.define(
|
||||
'Charge',
|
||||
{
|
||||
id: { type: DataTypes.UUID, primaryKey: true, allowNull: false },
|
||||
description: DataTypes.STRING,
|
||||
amount: DataTypes.INTEGER,
|
||||
|
||||
payment_status: {
|
||||
type: DataTypes.STRING,
|
||||
allowNull: false,
|
||||
references: {
|
||||
model: PaymentStatus(sequelize, DataTypes),
|
||||
key: 'name'
|
||||
payment_status: {
|
||||
type: DataTypes.STRING,
|
||||
allowNull: false,
|
||||
references: {
|
||||
model: PaymentStatus(sequelize, DataTypes),
|
||||
key: 'name'
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
freezeTableName: true,
|
||||
|
||||
// define the table's name
|
||||
tableName: 'charges'
|
||||
}
|
||||
});
|
||||
);
|
||||
|
||||
return Charge;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user