Change file size from int to int64

Signed-off-by: Yannis Varni <yannis@edinomis.fr>
This commit is contained in:
yvarni
2025-09-26 09:41:19 +02:00
committed by Sacha Al Himdani
parent c975ebce88
commit 0f8135482e
11 changed files with 17 additions and 12 deletions

View File

@@ -32,7 +32,7 @@ type (
MimeType string `db:"mime_type"`
FileName string `db:"file_name"`
FileKey string `db:"file_key"`
FileSize int `db:"file_size"`
FileSize int64 `db:"file_size"`
CreatedAt time.Time `db:"created_at"`
UpdatedAt time.Time `db:"updated_at"`
DeletedAt *time.Time `db:"deleted_at"`

View File

@@ -0,0 +1,5 @@
ALTER TABLE files
ALTER COLUMN file_size TYPE bigint;
ALTER TABLE vendor_compliance_reports
ALTER COLUMN file_size TYPE bigint;

View File

@@ -34,7 +34,7 @@ type (
ValidUntil *time.Time
ReportName string
FileKey string
FileSize int
FileSize int64
SnapshotID *gid.GID
SourceID *gid.GID
CreatedAt time.Time

View File

@@ -1251,7 +1251,7 @@ func (s *DocumentService) BuildAndUploadExport(ctx context.Context, exportJobID
MimeType: "application/zip",
FileName: fmt.Sprintf("Documents Export %s.zip", now.Format("2006-01-02")),
FileKey: uuid.String(),
FileSize: int(fileInfo.Size()),
FileSize: fileInfo.Size(),
CreatedAt: now,
UpdatedAt: now,
}

View File

@@ -823,7 +823,7 @@ func (s *FrameworkService) BuildAndUploadExport(ctx context.Context, exportJobID
MimeType: "application/zip",
FileName: fmt.Sprintf("Framework Export %s.zip", now.Format("2006-01-02")),
FileKey: uuid.String(),
FileSize: int(fileInfo.Size()),
FileSize: fileInfo.Size(),
CreatedAt: now,
UpdatedAt: now,
}

View File

@@ -384,7 +384,7 @@ func (s TrustCenterReferenceService) uploadLogoFile(
MimeType: contentType,
FileName: filename,
FileKey: objectKey.String(),
FileSize: int(fileSize),
FileSize: fileSize,
CreatedAt: now,
UpdatedAt: now,
}

View File

@@ -220,7 +220,7 @@ func (s TrustCenterService) UploadNDA(
MimeType: mimeType,
FileName: req.FileName,
FileKey: objectKey.String(),
FileSize: int(*headOutput.ContentLength),
FileSize: *headOutput.ContentLength,
CreatedAt: now,
UpdatedAt: now,
}

View File

@@ -132,7 +132,7 @@ func (s VendorBusinessAssociateAgreementService) Upload(
MimeType: mimeType,
FileName: req.FileName,
FileKey: objectKey.String(),
FileSize: int(*headOutput.ContentLength),
FileSize: *headOutput.ContentLength,
CreatedAt: now,
UpdatedAt: now,
}

View File

@@ -107,7 +107,7 @@ func (s VendorComplianceReportService) Upload(
ValidUntil: req.ValidUntil,
ReportName: req.ReportName,
FileKey: objectKey.String(),
FileSize: int(*headOutput.ContentLength),
FileSize: *headOutput.ContentLength,
CreatedAt: now,
UpdatedAt: now,
}

View File

@@ -132,7 +132,7 @@ func (s VendorDataPrivacyAgreementService) Upload(
MimeType: mimeType,
FileName: req.FileName,
FileKey: objectKey.String(),
FileSize: int(*headOutput.ContentLength),
FileSize: *headOutput.ContentLength,
CreatedAt: now,
UpdatedAt: now,
}

View File

@@ -2046,7 +2046,7 @@ type VendorBusinessAssociateAgreement struct {
ValidUntil *time.Time `json:"validUntil,omitempty"`
FileName string `json:"fileName"`
FileURL string `json:"fileUrl"`
FileSize int `json:"fileSize"`
FileSize int64 `json:"fileSize"`
CreatedAt time.Time `json:"createdAt"`
UpdatedAt time.Time `json:"updatedAt"`
}
@@ -2061,7 +2061,7 @@ type VendorComplianceReport struct {
ValidUntil *time.Time `json:"validUntil,omitempty"`
ReportName string `json:"reportName"`
FileURL string `json:"fileUrl"`
FileSize int `json:"fileSize"`
FileSize int64 `json:"fileSize"`
CreatedAt time.Time `json:"createdAt"`
UpdatedAt time.Time `json:"updatedAt"`
}
@@ -2110,7 +2110,7 @@ type VendorDataPrivacyAgreement struct {
ValidUntil *time.Time `json:"validUntil,omitempty"`
FileName string `json:"fileName"`
FileURL string `json:"fileUrl"`
FileSize int `json:"fileSize"`
FileSize int64 `json:"fileSize"`
CreatedAt time.Time `json:"createdAt"`
UpdatedAt time.Time `json:"updatedAt"`
}