mirror of
https://github.com/fosrl/pangolin.git
synced 2025-08-31 15:09:39 +02:00
add supporer key program
This commit is contained in:
parent
1c2ba4076a
commit
cdc415079c
17 changed files with 908 additions and 74 deletions
|
@ -17,6 +17,7 @@ import m8 from "./scripts/1.0.0-beta12";
|
|||
import m13 from "./scripts/1.0.0-beta13";
|
||||
import m15 from "./scripts/1.0.0-beta15";
|
||||
import m16 from "./scripts/1.0.0";
|
||||
import m17 from "./scripts/1.1.0";
|
||||
|
||||
// THIS CANNOT IMPORT ANYTHING FROM THE SERVER
|
||||
// EXCEPT FOR THE DATABASE AND THE SCHEMA
|
||||
|
@ -33,7 +34,8 @@ const migrations = [
|
|||
{ version: "1.0.0-beta.12", run: m8 },
|
||||
{ version: "1.0.0-beta.13", run: m13 },
|
||||
{ version: "1.0.0-beta.15", run: m15 },
|
||||
{ version: "1.0.0", run: m16 }
|
||||
{ version: "1.0.0", run: m16 },
|
||||
{ version: "1.1.0", run: m17 }
|
||||
// Add new migrations here as they are created
|
||||
] as const;
|
||||
|
||||
|
|
28
server/setup/scripts/1.1.0.ts
Normal file
28
server/setup/scripts/1.1.0.ts
Normal file
|
@ -0,0 +1,28 @@
|
|||
import db from "@server/db";
|
||||
import { sql } from "drizzle-orm";
|
||||
|
||||
const version = "1.1.0";
|
||||
|
||||
export default async function migration() {
|
||||
console.log(`Running setup script ${version}...`);
|
||||
|
||||
try {
|
||||
db.transaction((trx) => {
|
||||
trx.run(sql`CREATE TABLE 'supporterKey' (
|
||||
'keyId' integer PRIMARY KEY AUTOINCREMENT NOT NULL,
|
||||
'key' text NOT NULL,
|
||||
'githubUsername' text NOT NULL,
|
||||
'phrase' text,
|
||||
'tier' text,
|
||||
'valid' integer DEFAULT false NOT NULL
|
||||
);`);
|
||||
});
|
||||
|
||||
console.log(`Migrated database schema`);
|
||||
} catch (e) {
|
||||
console.log("Unable to migrate database schema");
|
||||
throw e;
|
||||
}
|
||||
|
||||
console.log(`${version} migration complete`);
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue