unnecessary associations, rather do references

This commit is contained in:
Arjun Patel
2019-03-17 00:14:59 -07:00
parent ee66f2363e
commit 7e76fbe31e
-24
View File
@@ -1,24 +0,0 @@
module.exports = models => {
const {
donor,
Grant,
Cause,
Region,
Organization,
Charge,
PaymentPlan,
GrantsOrganizations,
Project
} = models;
console.log(models);
donor.hasMany(Grant, { foreignKey: 'donor_id' });
Grant.belongsToMany(Organization, {
through: 'Grant_Organization',
foreignKey: 'grant_id',
otherKey: 'organization_id'
});
Grant.hasMany(Charge, { foreignKey: 'grant_id' });
};