mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-18 04:58:28 +00:00
Merge remote-tracking branch 'origin/main' into pki-revamp
This commit is contained in:
@@ -2,7 +2,9 @@ import knex, { Knex } from "knex";
|
||||
|
||||
const parseSslConfig = (dbConnectionUri: string, dbRootCert?: string) => {
|
||||
let modifiedDbConnectionUri = dbConnectionUri;
|
||||
let sslConfig: { rejectUnauthorized: boolean; ca: string } | boolean = false;
|
||||
let sslConfig: { rejectUnauthorized: boolean; ca: string } | boolean = dbRootCert
|
||||
? { rejectUnauthorized: true, ca: Buffer.from(dbRootCert, "base64").toString("ascii") }
|
||||
: false;
|
||||
|
||||
if (dbRootCert) {
|
||||
const url = new URL(dbConnectionUri);
|
||||
|
||||
@@ -0,0 +1,23 @@
|
||||
import { Knex } from "knex";
|
||||
|
||||
import { TableName } from "../schemas";
|
||||
|
||||
export async function up(knex: Knex): Promise<void> {
|
||||
const hasScopeColumn = await knex.schema.hasColumn(TableName.Membership, "scope");
|
||||
const hasActorIdentityColumn = await knex.schema.hasColumn(TableName.Membership, "actorIdentityId");
|
||||
if (hasScopeColumn && hasActorIdentityColumn) {
|
||||
await knex.schema.alterTable(TableName.Membership, (t) => {
|
||||
t.index(["scope", "actorIdentityId"]);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
export async function down(knex: Knex): Promise<void> {
|
||||
const hasScopeColumn = await knex.schema.hasColumn(TableName.Membership, "scope");
|
||||
const hasActorIdentityColumn = await knex.schema.hasColumn(TableName.Membership, "actorIdentityId");
|
||||
if (hasScopeColumn && hasActorIdentityColumn) {
|
||||
await knex.schema.alterTable(TableName.Membership, (t) => {
|
||||
t.dropIndex(["scope", "actorIdentityId"]);
|
||||
});
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user