Fix missing organization ID on reports
Signed-off-by: Émile Ré <nemile.re@gmail.com>
This commit is contained in:
8
pkg/coredata/migrations/20251204T000000Z.sql
Normal file
8
pkg/coredata/migrations/20251204T000000Z.sql
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
UPDATE
|
||||||
|
reports
|
||||||
|
SET
|
||||||
|
organization_id = a.organization_id
|
||||||
|
FROM
|
||||||
|
audits a
|
||||||
|
WHERE
|
||||||
|
reports.tenant_id = a.tenant_id;
|
||||||
@@ -346,13 +346,14 @@ func (s AuditService) UploadReport(
|
|||||||
}
|
}
|
||||||
|
|
||||||
report := &coredata.Report{
|
report := &coredata.Report{
|
||||||
ID: reportID,
|
ID: reportID,
|
||||||
ObjectKey: objectKey.String(),
|
OrganizationID: audit.OrganizationID,
|
||||||
MimeType: req.File.ContentType,
|
ObjectKey: objectKey.String(),
|
||||||
Filename: req.File.Filename,
|
MimeType: req.File.ContentType,
|
||||||
Size: req.File.Size,
|
Filename: req.File.Filename,
|
||||||
CreatedAt: now,
|
Size: req.File.Size,
|
||||||
UpdatedAt: now,
|
CreatedAt: now,
|
||||||
|
UpdatedAt: now,
|
||||||
}
|
}
|
||||||
|
|
||||||
if err := report.Insert(ctx, conn, s.svc.scope); err != nil {
|
if err := report.Insert(ctx, conn, s.svc.scope); err != nil {
|
||||||
|
|||||||
Reference in New Issue
Block a user