shorten share links and add migration

This commit is contained in:
miloschwartz 2025-04-04 22:58:01 -04:00
parent 302094771b
commit 74d6b3d902
No known key found for this signature in database
12 changed files with 231 additions and 63 deletions

View file

@ -0,0 +1,23 @@
import db from "@server/db";
import { sql } from "drizzle-orm";
const version = "1.2.0";
export default async function migration() {
console.log(`Running setup script ${version}...`);
try {
db.transaction((trx) => {
trx.run(
sql`ALTER TABLE 'resources' ADD 'enabled' integer DEFAULT true NOT NULL;`
);
});
console.log(`Migrated database schema`);
} catch (e) {
console.log("Unable to migrate database schema");
throw e;
}
console.log(`${version} migration complete`);
}