Left Join-ing on roles to allow users without roles to login (#10836)

* Left Join-ing on roles to allow users without roles to login

* moving filter logic to more appropriate location
This commit is contained in:
John Huffsmith
2022-01-04 12:24:44 -05:00
committed by GitHub
parent 2724d306ea
commit 8a05018883
4 changed files with 32 additions and 4 deletions

View File

@@ -14,9 +14,7 @@ export default async function run(database: Knex, direction: 'up' | 'down' | 'la
let customMigrationFiles =
((await fse.pathExists(customMigrationsPath)) && (await fse.readdir(customMigrationsPath))) || [];
migrationFiles = migrationFiles.filter(
(file: string) => file.startsWith('run') === false && file.endsWith('.d.ts') === false
);
migrationFiles = migrationFiles.filter((file: string) => file.startsWith('run') === false && file.endsWith('.js'));
customMigrationFiles = customMigrationFiles.filter((file: string) => file.endsWith('.js'));
const completedMigrations = await database.select<Migration[]>('*').from('directus_migrations').orderBy('version');