mirror of
https://github.com/directus/directus.git
synced 2026-02-11 16:24:57 -05:00
Warn on Missing Migrations (#6580)
* added warn when migrations have not all been run * fixed imports * added better error handling * Update api/src/database/index.ts Co-authored-by: Rijk van Zanten <rijkvanzanten@me.com> * migration is its own file * added custom migrations path * Handle non-existing custom migrations folder Co-authored-by: jaycammarano <jaycammarano@gmail.com> Co-authored-by: Rijk van Zanten <rijkvanzanten@me.com>
This commit is contained in:
@@ -5,12 +5,7 @@ import fse from 'fs-extra';
|
||||
import { Knex } from 'knex';
|
||||
import path from 'path';
|
||||
import env from '../../env';
|
||||
|
||||
type Migration = {
|
||||
version: string;
|
||||
name: string;
|
||||
timestamp: Date;
|
||||
};
|
||||
import { Migration } from '../../types';
|
||||
|
||||
export default async function run(database: Knex, direction: 'up' | 'down' | 'latest'): Promise<void> {
|
||||
let migrationFiles = await fse.readdir(__dirname);
|
||||
|
||||
Reference in New Issue
Block a user