mirror of
https://github.com/fosrl/pangolin.git
synced 2026-06-13 10:56:56 +00:00
Adjust 1.19 and add 1.19.1 to ensure sso not null
This commit is contained in:
@@ -680,25 +680,6 @@ export default async function migration() {
|
||||
deleteResourceRules.run(resource.resourceId);
|
||||
deleteResourceWhitelist.run(resource.resourceId);
|
||||
}
|
||||
// remove not null/default from sso, applyRules, and emailWhitelistEnabled in preparation for resource policies
|
||||
db.prepare(`ALTER TABLE 'resources' DROP COLUMN 'sso';`).run();
|
||||
db.prepare(
|
||||
`ALTER TABLE 'resources' ADD COLUMN 'sso' integer;`
|
||||
).run();
|
||||
|
||||
db.prepare(
|
||||
`ALTER TABLE 'resources' DROP COLUMN 'applyRules';`
|
||||
).run();
|
||||
db.prepare(
|
||||
`ALTER TABLE 'resources' ADD COLUMN 'applyRules' integer;`
|
||||
).run();
|
||||
|
||||
db.prepare(
|
||||
`ALTER TABLE 'resources' DROP COLUMN 'emailWhitelistEnabled';`
|
||||
).run();
|
||||
db.prepare(
|
||||
`ALTER TABLE 'resources' ADD COLUMN 'emailWhitelistEnabled' integer;`
|
||||
).run();
|
||||
});
|
||||
|
||||
migrateInlinePolicies();
|
||||
@@ -707,6 +688,29 @@ export default async function migration() {
|
||||
);
|
||||
}
|
||||
|
||||
// add one more transaction
|
||||
db.transaction(() => {
|
||||
// remove not null/default from sso, applyRules, and emailWhitelistEnabled in preparation for resource policies
|
||||
db.prepare(`ALTER TABLE 'resources' DROP COLUMN 'sso';`).run();
|
||||
db.prepare(
|
||||
`ALTER TABLE 'resources' ADD COLUMN 'sso' integer;`
|
||||
).run();
|
||||
|
||||
db.prepare(
|
||||
`ALTER TABLE 'resources' DROP COLUMN 'applyRules';`
|
||||
).run();
|
||||
db.prepare(
|
||||
`ALTER TABLE 'resources' ADD COLUMN 'applyRules' integer;`
|
||||
).run();
|
||||
|
||||
db.prepare(
|
||||
`ALTER TABLE 'resources' DROP COLUMN 'emailWhitelistEnabled';`
|
||||
).run();
|
||||
db.prepare(
|
||||
`ALTER TABLE 'resources' ADD COLUMN 'emailWhitelistEnabled' integer;`
|
||||
).run();
|
||||
})();
|
||||
|
||||
console.log("Migrated database");
|
||||
} catch (e) {
|
||||
console.log("Failed to migrate db:", e);
|
||||
|
||||
Reference in New Issue
Block a user