refactor: autoRemount as boolean

This commit is contained in:
Nicolas Meienberger
2025-09-27 10:51:31 +02:00
parent 592a8f52b7
commit 082192f38a
12 changed files with 239 additions and 81 deletions

View File

@@ -13,7 +13,7 @@ export const volumesTable = sqliteTable("volumes_table", {
createdAt: int("created_at", { mode: "timestamp" }).notNull().default(sql`(unixepoch())`),
updatedAt: int("updated_at", { mode: "timestamp" }).notNull().default(sql`(unixepoch())`),
config: text("config", { mode: "json" }).$type<typeof volumeConfigSchema.inferOut>().notNull(),
autoRemount: int("auto_remount").$type<1 | 0>().notNull().default(1),
autoRemount: int("auto_remount", { mode: "boolean" }).notNull().default(true),
});
export type Volume = typeof volumesTable.$inferSelect;

View File

@@ -13,7 +13,7 @@ const volumeSchema = type({
updatedAt: "number",
lastHealthCheck: "number",
config: volumeConfigSchema,
autoRemount: "0 | 1",
autoRemount: "boolean",
});
export type VolumeDto = typeof volumeSchema.infer;

View File

@@ -155,7 +155,7 @@ const testConnection = async (backendConfig: BackendConfig) => {
type: backendConfig.backend,
status: "unmounted" as const,
lastError: null,
autoRemount: 0 as const,
autoRemount: true,
};
const backend = createVolumeBackend(mockVolume);