added auth strategies migration, fixed rebuild of modules on migrations

This commit is contained in:
dswbx
2025-02-27 10:08:22 +01:00
parent 7743f71a11
commit dd48962901
10 changed files with 854 additions and 33 deletions

View File

@@ -1,4 +1,4 @@
import { _jsonp } from "core/utils";
import { _jsonp, transformObject } from "core/utils";
import { type Kysely, sql } from "kysely";
import { set } from "lodash-es";
@@ -72,13 +72,25 @@ export const migrations: Migration[] = [
};
},
},
/*{
{
version: 8,
up: async (config, { db }) => {
await db.deleteFrom(TABLE_NAME).where("type", "=", "diff").execute();
return config;
}
}*/
up: async (config) => {
const strategies = transformObject(config.auth.strategies, (strategy) => {
return {
...strategy,
enabled: true,
};
});
return {
...config,
auth: {
...config.auth,
strategies: strategies,
},
};
},
},
];
export const CURRENT_VERSION = migrations[migrations.length - 1]?.version ?? 0;