v3: allow users to edit dump thumbnail, fixed some linter errors in the frontend
All checks were successful
Build and Publish Docker Image / build-and-push (push) Successful in 41s
All checks were successful
Build and Publish Docker Image / build-and-push (push) Successful in 41s
This commit is contained in:
14
api/db/migrations/0002_dump_thumbnail.ts
Normal file
14
api/db/migrations/0002_dump_thumbnail.ts
Normal file
@@ -0,0 +1,14 @@
|
||||
import type { DatabaseSync } from "node:sqlite";
|
||||
|
||||
// Idempotent: safe to run against a fresh db (already created from schema.sql
|
||||
// with this column) or an existing one that predates it.
|
||||
export function up(db: DatabaseSync): void {
|
||||
const dumpCols = db.prepare(`PRAGMA table_info(dumps);`).all() as {
|
||||
name: string;
|
||||
}[];
|
||||
if (!dumpCols.some((c) => c.name === "custom_thumbnail_mime")) {
|
||||
db.exec(
|
||||
`ALTER TABLE dumps ADD COLUMN custom_thumbnail_mime TEXT;`,
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user