-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: perfect associations, seed association data, eager loading
- Loading branch information
Michael.Taylor
committed
Dec 16, 2021
1 parent
4dc71a6
commit 5c011a2
Showing
26 changed files
with
227 additions
and
171 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,22 @@ | ||
'use strict'; | ||
const UnitStub = require('../src/models/units/units.stub.json'); | ||
|
||
const JunctionStub = [ | ||
{ | ||
unitId: 1, | ||
qualificationId: 1, | ||
}, | ||
{ | ||
unitId: 1, | ||
qualificationId: 2, | ||
}, | ||
]; | ||
module.exports = { | ||
up: async (queryInterface) => | ||
queryInterface.bulkInsert('Units', UnitStub, {}), | ||
up: async (queryInterface) => { | ||
await queryInterface.bulkInsert('units', UnitStub, {}); | ||
await queryInterface.bulkInsert('qualification_unit', JunctionStub, {}); | ||
}, | ||
|
||
down: async (queryInterface) => { | ||
await queryInterface.bulkDelete('Units'); | ||
await queryInterface.bulkDelete('units'); | ||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,22 @@ | ||
[ | ||
{ | ||
"cobenefit": "TEST_COBENEFIT_1" | ||
"benefit": "TEST_COBENEFIT_1", | ||
"projectId": 1 | ||
}, | ||
{ | ||
"cobenefit": "TEST_COBENEFIT_2" | ||
"benefit": "TEST_COBENEFIT_2", | ||
"projectId": 1 | ||
}, | ||
{ | ||
"cobenefit": "TEST_COBENEFIT_3" | ||
"benefit": "TEST_COBENEFIT_3", | ||
"projectId": 1 | ||
}, | ||
{ | ||
"cobenefit": "TEST_COBENEFIT_4" | ||
"benefit": "TEST_COBENEFIT_4", | ||
"projectId": 1 | ||
}, | ||
{ | ||
"cobenefit": "TEST_COBENEFIT_5" | ||
"benefit": "TEST_COBENEFIT_5", | ||
"projectId": 1 | ||
} | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,22 @@ | ||
[ | ||
{ | ||
"in_country_region": true, | ||
"host_country": "United States" | ||
"countryRegion": "United States", | ||
"projectId": 1 | ||
}, | ||
{ | ||
"in_country_region": true, | ||
"host_country": "United States" | ||
"countryRegion": "United States", | ||
"projectId": 1 | ||
}, | ||
{ | ||
"in_country_region": false, | ||
"host_country": "China" | ||
"countryRegion": "China", | ||
"projectId": 2 | ||
}, | ||
{ | ||
"in_country_region": false, | ||
"host_country": "Russia" | ||
"countryRegion": "Russia", | ||
"projectId": 2 | ||
}, | ||
{ | ||
"in_country_region": true, | ||
"host_country": "United States" | ||
"countryRegion": "United States", | ||
"projectId": 2 | ||
} | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.