feat: volume type icon

This commit is contained in:
Nicolas Meienberger
2025-09-03 21:55:01 +02:00
parent 91020e6f23
commit 63b983b1b1
5 changed files with 70 additions and 9 deletions

View File

@@ -1,4 +1,4 @@
import type { volumeConfigSchema } from "@ironmount/schemas";
import type { BackendType, volumeConfigSchema } from "@ironmount/schemas";
import { sql } from "drizzle-orm";
import { int, sqliteTable, text } from "drizzle-orm/sqlite-core";
@@ -6,7 +6,7 @@ export const volumesTable = sqliteTable("volumes_table", {
id: int().primaryKey({ autoIncrement: true }),
name: text().notNull().unique(),
path: text().notNull(),
type: text().notNull(),
type: text().$type<BackendType>().notNull(),
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(),