fix: replace integer column with bigint for size (#295)

Co-authored-by: charles-gauthereau <charles.gauthereau@soluce-technologies.com>
This commit is contained in:
Charles GTE
2026-05-21 07:51:08 +02:00
committed by GitHub
co-authored by charles-gauthereau
parent 27f6b746e0
commit 965b215224
5 changed files with 2675 additions and 4 deletions
@@ -0,0 +1,2 @@
ALTER TABLE "backups" ALTER COLUMN "file_size" SET DATA TYPE bigint;--> statement-breakpoint
ALTER TABLE "backup_storage" ALTER COLUMN "size" SET DATA TYPE bigint;
File diff suppressed because it is too large Load Diff
+7
View File
@@ -386,6 +386,13 @@
"when": 1778523056918,
"tag": "0054_hesitant_darkhawk",
"breakpoints": true
},
{
"idx": 55,
"version": "7",
"when": 1779342014802,
"tag": "0055_yielding_justin_hammer",
"breakpoints": true
}
]
}
+2 -2
View File
@@ -1,4 +1,4 @@
import {pgTable, text, boolean, timestamp, uuid, integer, pgEnum} from "drizzle-orm/pg-core";
import {pgTable, text, boolean, timestamp, uuid, integer, pgEnum, bigint} from "drizzle-orm/pg-core";
import {Agent, agent, AgentWith} from "./08_agent";
import {Project, project} from "./06_project";
import {relations} from "drizzle-orm";
@@ -37,7 +37,7 @@ export const backup = pgTable(
id: uuid("id").primaryKey().defaultRandom(),
status: statusEnum("status").default("waiting").notNull(),
file: text("file"),
fileSize: integer("file_size"),
fileSize: bigint("file_size", { mode: "number" }),
databaseId: uuid("database_id")
.notNull()
.references(() => database.id, {onDelete: "cascade"}),
+2 -2
View File
@@ -1,4 +1,4 @@
import { pgTable, uuid, text, integer, pgEnum } from "drizzle-orm/pg-core";
import {pgTable, uuid, text, integer, pgEnum, bigint} from "drizzle-orm/pg-core";
import { timestamps } from "@/db/schema/00_common";
import {StorageChannel, storageChannel} from "@/db/schema/12_storage-channel";
import {Backup, backup, Restoration} from "@/db/schema/07_database";
@@ -22,7 +22,7 @@ export const backupStorage = pgTable("backup_storage", {
.references(() => storageChannel.id, { onDelete: "cascade" }),
status: backupStorageStatusEnum("status").notNull().default("pending"),
path: text("path"),
size: integer("size"),
size: bigint("size", { mode: "number" }),
checksum: text("checksum"),
...timestamps,
});