working changes to use sequelize auto index

This commit is contained in:
Arjun Patel
2019-03-16 22:41:57 -07:00
parent 52c284f02a
commit e5c204890e
26 changed files with 82 additions and 91 deletions
+3 -11
View File
@@ -1,6 +1,6 @@
module.exports = models => {
const {
Donor,
donor,
Grant,
Cause,
Region,
@@ -10,8 +10,9 @@ module.exports = models => {
GrantsOrganizations,
Project
} = models;
console.log(models);
Donor.hasMany(Grant, { foreignKey: 'donor_id' });
donor.hasMany(Grant, { foreignKey: 'donor_id' });
Grant.belongsToMany(Organization, {
through: 'grants_organizations',
@@ -20,13 +21,4 @@ module.exports = models => {
});
Grant.hasMany(Charge, { foreignKey: 'grant_id' });
Donor.hasMany(PaymentPlan, {
foreignKey: 'subscription_id',
sourceKey: 'subscription_id'
});
Grant.hasOne(PaymentPlan, {
foreignKey: 'grant_id'
});
};