mirror of
https://github.com/fosrl/pangolin.git
synced 2025-05-17 15:47:50 +01:00
added table change to new migration script
This commit is contained in:
parent
674316aa46
commit
517bc7f632
2 changed files with 26 additions and 1 deletions
|
@ -19,6 +19,7 @@ import m15 from "./scripts/1.0.0-beta15";
|
||||||
import m16 from "./scripts/1.0.0";
|
import m16 from "./scripts/1.0.0";
|
||||||
import m17 from "./scripts/1.1.0";
|
import m17 from "./scripts/1.1.0";
|
||||||
import m18 from "./scripts/1.2.0";
|
import m18 from "./scripts/1.2.0";
|
||||||
|
import m19 from "./scripts/1.3.0";
|
||||||
|
|
||||||
// THIS CANNOT IMPORT ANYTHING FROM THE SERVER
|
// THIS CANNOT IMPORT ANYTHING FROM THE SERVER
|
||||||
// EXCEPT FOR THE DATABASE AND THE SCHEMA
|
// EXCEPT FOR THE DATABASE AND THE SCHEMA
|
||||||
|
@ -37,7 +38,8 @@ const migrations = [
|
||||||
{ version: "1.0.0-beta.15", run: m15 },
|
{ 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 },
|
{ version: "1.1.0", run: m17 },
|
||||||
{ version: "1.2.0", run: m18 }
|
{ version: "1.2.0", run: m18 },
|
||||||
|
{ version: "1.3.0", run: m19 }
|
||||||
// Add new migrations here as they are created
|
// Add new migrations here as they are created
|
||||||
] as const;
|
] as const;
|
||||||
|
|
||||||
|
|
23
server/setup/scripts/1.3.0.ts
Normal file
23
server/setup/scripts/1.3.0.ts
Normal file
|
@ -0,0 +1,23 @@
|
||||||
|
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`ALTER TABLE 'resources' ADD 'tlsServerName' integer DEFAULT '' NOT NULL;`
|
||||||
|
);
|
||||||
|
});
|
||||||
|
|
||||||
|
console.log(`Migrated database schema`);
|
||||||
|
} catch (e) {
|
||||||
|
console.log("Unable to migrate database schema");
|
||||||
|
throw e;
|
||||||
|
}
|
||||||
|
|
||||||
|
console.log(`${version} migration complete`);
|
||||||
|
}
|
Loading…
Reference in a new issue