mirror of
https://github.com/fosrl/pangolin.git
synced 2025-07-28 14:44:55 +02:00
minor fixes for release
This commit is contained in:
parent
92c09b8843
commit
665ef08733
6 changed files with 88 additions and 71 deletions
|
@ -11,6 +11,8 @@ export default async function migration() {
|
|||
const db = new Database(location);
|
||||
|
||||
try {
|
||||
db.pragma("foreign_keys = OFF");
|
||||
|
||||
db.transaction(() => {
|
||||
db.exec(`
|
||||
CREATE TABLE 'clientSites' (
|
||||
|
@ -99,8 +101,6 @@ export default async function migration() {
|
|||
|
||||
`);
|
||||
|
||||
db.pragma("foreign_keys = OFF");
|
||||
|
||||
db.exec(`
|
||||
CREATE TABLE '__new_sites' (
|
||||
'siteId' integer PRIMARY KEY AUTOINCREMENT NOT NULL,
|
||||
|
@ -135,8 +135,6 @@ export default async function migration() {
|
|||
ALTER TABLE '__new_sites' RENAME TO 'sites';
|
||||
`);
|
||||
|
||||
db.pragma("foreign_keys = ON");
|
||||
|
||||
db.exec(`
|
||||
ALTER TABLE 'domains' ADD 'type' text;
|
||||
ALTER TABLE 'domains' ADD 'verified' integer DEFAULT 0 NOT NULL;
|
||||
|
@ -148,7 +146,10 @@ export default async function migration() {
|
|||
ALTER TABLE 'user' ADD 'twoFactorSetupRequested' integer DEFAULT 0;
|
||||
ALTER TABLE 'resources' DROP COLUMN 'isBaseDomain';
|
||||
`);
|
||||
})(); // <-- executes the transaction immediately
|
||||
})();
|
||||
|
||||
db.pragma("foreign_keys = ON");
|
||||
|
||||
console.log(`Migrated database schema`);
|
||||
} catch (e) {
|
||||
console.log("Unable to migrate database schema");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue