Skip to content

Commit 42c1489

Browse files
author
Andrew Farries
committed
Change type of field in GORM model
1 parent 9073e40 commit 42c1489

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

components/usage/pkg/controller/reconciler.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,7 @@ func usageReportToUsageRecords(report UsageReport, pricer *WorkspacePricer, now
248248
AttributionID: attributionId,
249249
StartedAt: instance.CreationTime.Time(),
250250
StoppedAt: stoppedAt,
251-
CreditsUsed: float64(pricer.CreditsUsedByInstance(&instance, now)),
251+
CreditsUsed: pricer.CreditsUsedByInstance(&instance, now),
252252
GenerationId: 0,
253253
Deleted: false,
254254
})

components/usage/pkg/db/workspace_instance_usage.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ type WorkspaceInstanceUsage struct {
1919
AttributionID AttributionID `gorm:"column:attributionId;type:varchar;size:255;" json:"attributionId"`
2020
StartedAt time.Time `gorm:"column:startedAt;type:timestamp;default:CURRENT_TIMESTAMP(6);" json:"startedAt"`
2121
StoppedAt sql.NullTime `gorm:"column:stoppedAt;type:timestamp;" json:"stoppedAt"`
22-
CreditsUsed float64 `gorm:"column:creditsUsed;type:double;" json:"creditsUsed"`
22+
CreditsUsed int64 `gorm:"column:creditsUsed;type:int;" json:"creditsUsed"`
2323
GenerationId int `gorm:"column:generationId;type:int;" json:"generationId"`
2424
Deleted bool `gorm:"column:deleted;type:tinyint;default:0;" json:"deleted"`
2525
}

0 commit comments

Comments
 (0)