mirror of
https://github.com/fosrl/pangolin.git
synced 2026-07-06 12:19:50 +00:00
standardize client titles
This commit is contained in:
@@ -619,6 +619,14 @@ export default async function migration() {
|
|||||||
`);
|
`);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// clear the sso, applyRules, and emailWhitelistEnabled columns on all resources since that information is now in the resource policies
|
||||||
|
await db.execute(sql`
|
||||||
|
UPDATE "resources"
|
||||||
|
SET "sso" = null,
|
||||||
|
"applyRules" = null,
|
||||||
|
"emailWhitelistEnabled" = null
|
||||||
|
`);
|
||||||
|
|
||||||
await db.execute(sql`COMMIT`);
|
await db.execute(sql`COMMIT`);
|
||||||
console.log(
|
console.log(
|
||||||
`Migrated inline resource policies for ${existingResources.length} resource(s)`
|
`Migrated inline resource policies for ${existingResources.length} resource(s)`
|
||||||
|
|||||||
@@ -360,42 +360,6 @@ export default async function migration() {
|
|||||||
ALTER TABLE 'targets' ADD 'authToken' text;
|
ALTER TABLE 'targets' ADD 'authToken' text;
|
||||||
`
|
`
|
||||||
).run();
|
).run();
|
||||||
|
|
||||||
// remove not null/default from sso, applyRules, and emailWhitelistEnabled in preparation for resource policies
|
|
||||||
db.prepare(
|
|
||||||
`ALTER TABLE 'resources' ADD COLUMN 'sso2' integer;`
|
|
||||||
).run();
|
|
||||||
db.prepare(`UPDATE 'resources' SET 'sso2' = 'sso';`).run();
|
|
||||||
db.prepare(`ALTER TABLE 'resources' DROP COLUMN 'sso';`).run();
|
|
||||||
db.prepare(
|
|
||||||
`ALTER TABLE 'resources' RENAME COLUMN 'sso2' TO 'sso';`
|
|
||||||
).run();
|
|
||||||
|
|
||||||
db.prepare(
|
|
||||||
`ALTER TABLE 'resources' ADD COLUMN 'applyRules2' integer;`
|
|
||||||
).run();
|
|
||||||
db.prepare(
|
|
||||||
`UPDATE 'resources' SET 'applyRules2' = 'applyRules';`
|
|
||||||
).run();
|
|
||||||
db.prepare(
|
|
||||||
`ALTER TABLE 'resources' DROP COLUMN 'applyRules';`
|
|
||||||
).run();
|
|
||||||
db.prepare(
|
|
||||||
`ALTER TABLE 'resources' RENAME COLUMN 'applyRules2' TO 'applyRules';`
|
|
||||||
).run();
|
|
||||||
|
|
||||||
db.prepare(
|
|
||||||
`ALTER TABLE 'resources' ADD COLUMN 'emailWhitelistEnabled2' integer;`
|
|
||||||
).run();
|
|
||||||
db.prepare(
|
|
||||||
`UPDATE 'resources' SET 'emailWhitelistEnabled2' = 'emailWhitelistEnabled';`
|
|
||||||
).run();
|
|
||||||
db.prepare(
|
|
||||||
`ALTER TABLE 'resources' DROP COLUMN 'emailWhitelistEnabled';`
|
|
||||||
).run();
|
|
||||||
db.prepare(
|
|
||||||
`ALTER TABLE 'resources' RENAME COLUMN 'emailWhitelistEnabled2' TO 'emailWhitelistEnabled';`
|
|
||||||
).run();
|
|
||||||
})();
|
})();
|
||||||
|
|
||||||
const existingResources = db
|
const existingResources = db
|
||||||
@@ -716,6 +680,25 @@ export default async function migration() {
|
|||||||
deleteResourceRules.run(resource.resourceId);
|
deleteResourceRules.run(resource.resourceId);
|
||||||
deleteResourceWhitelist.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();
|
migrateInlinePolicies();
|
||||||
|
|||||||
Reference in New Issue
Block a user