mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-14 16:40:30 +00:00
25 lines
643 B
TypeScript
25 lines
643 B
TypeScript
import { Knex } from "knex";
|
|
import { TableName } from "../schemas";
|
|
|
|
export async function up(knex: Knex): Promise<void> {
|
|
await knex.schema.alterTable(TableName.Organization, (t) => {
|
|
t.boolean("authEnabled").defaultTo(false);
|
|
});
|
|
|
|
await knex(TableName.Organization)
|
|
.whereIn(
|
|
"id",
|
|
knex(TableName.SamlConfig)
|
|
.select("orgId")
|
|
.where("isActive", true)
|
|
)
|
|
.update({ authEnabled: true });
|
|
}
|
|
|
|
export async function down(knex: Knex): Promise<void> {
|
|
await knex.schema.alterTable(TableName.Organization, (t) => {
|
|
t.dropColumn("authEnabled");
|
|
});
|
|
}
|
|
|