Skip to content

Commit 3c12d8c

Browse files
author
Andrew Farries
committed
Change to bigint type
1 parent 4be8d13 commit 3c12d8c

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

components/gitpod-db/src/typeorm/entity/db-workspace-instance-usage.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ export class DBWorkspaceInstanceUsage {
3434
@Index("ind_stoppedAt")
3535
stoppedAt: string;
3636

37-
@Column("int")
37+
@Column("bigint")
3838
creditsUsed: number;
3939

4040
@Column()

components/gitpod-db/src/typeorm/migration/1658123555591-ChangeUsageCreditsColumnType.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ export class New1658123371893 implements MigrationInterface {
1414
await queryRunner.query(`DROP TABLE \`d_b_workspace_instance_usage\``);
1515

1616
await queryRunner.query(
17-
`CREATE TABLE \`d_b_workspace_instance_usage\` (\`instanceId\` char(36) NOT NULL, \`attributionId\` varchar(255) NOT NULL, \`startedAt\` timestamp(6) NOT NULL, \`stoppedAt\` timestamp(6) NULL, \`creditsUsed\` int NOT NULL, \`generationId\` int NOT NULL, \`deleted\` tinyint NOT NULL, INDEX \`ind_attributionId\` (\`attributionId\`), INDEX \`ind_startedAt\` (\`startedAt\`), INDEX \`ind_stoppedAt\` (\`stoppedAt\`), PRIMARY KEY (\`instanceId\`)) ENGINE=InnoDB`,
17+
`CREATE TABLE \`d_b_workspace_instance_usage\` (\`instanceId\` char(36) NOT NULL, \`attributionId\` varchar(255) NOT NULL, \`startedAt\` timestamp(6) NOT NULL, \`stoppedAt\` timestamp(6) NULL, \`creditsUsed\` bigint NOT NULL, \`generationId\` int NOT NULL, \`deleted\` tinyint NOT NULL, INDEX \`ind_attributionId\` (\`attributionId\`), INDEX \`ind_startedAt\` (\`startedAt\`), INDEX \`ind_stoppedAt\` (\`stoppedAt\`), PRIMARY KEY (\`instanceId\`)) ENGINE=InnoDB`,
1818
);
1919
}
2020

components/usage/pkg/db/workspace_instance_usage.go

Lines changed: 1 addition & 1 deletion
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 int64 `gorm:"column:creditsUsed;type:int;" json:"creditsUsed"`
22+
CreditsUsed int64 `gorm:"column:creditsUsed;type:bigint;" 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)