Skip to content

Commit 4094658

Browse files
committed
Update L2RasterProduct with Granules
1 parent 213ab71 commit 4094658

File tree

2 files changed

+122
-118
lines changed

2 files changed

+122
-118
lines changed

models/l2-raster-product.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import {DataTypes, Model} from 'sequelize';
22
import {v4 as uuidv4} from 'uuid';
3+
import Granule from './granule.js';
34
import Status from './status.js';
45
import User from './user.js';
56

@@ -57,6 +58,9 @@ export function init(sequelize) {
5758
* Setup model associations
5859
*/
5960
export function associate() {
61+
L2RasterProduct.hasMany(Granule, {
62+
foreignKey: 'productId',
63+
});
6064
L2RasterProduct.hasMany(Status, {
6165
foreignKey: 'productId',
6266
});

0 commit comments

Comments
 (0)