mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-06 13:27:22 +00:00
feat(user-auth): fix migration bug for e2e suite
This commit is contained in:
@@ -6,11 +6,15 @@ import { TableName } from "../schemas";
|
|||||||
|
|
||||||
export async function up(knex: Knex): Promise<void> {
|
export async function up(knex: Knex): Promise<void> {
|
||||||
const appCfg = getConfig();
|
const appCfg = getConfig();
|
||||||
|
const tokenDuration = appCfg?.JWT_REFRESH_LIFETIME;
|
||||||
|
|
||||||
if (!(await knex.schema.hasColumn(TableName.Organization, "userTokenExpiration"))) {
|
if (!(await knex.schema.hasColumn(TableName.Organization, "userTokenExpiration"))) {
|
||||||
await knex.schema.alterTable(TableName.Organization, (t) => {
|
await knex.schema.alterTable(TableName.Organization, (t) => {
|
||||||
t.string("userTokenExpiration");
|
t.string("userTokenExpiration");
|
||||||
});
|
});
|
||||||
await knex(TableName.Organization).update({ userTokenExpiration: appCfg.JWT_REFRESH_LIFETIME });
|
if (tokenDuration) {
|
||||||
|
await knex(TableName.Organization).update({ userTokenExpiration: tokenDuration });
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user