mirror of
https://github.com/directus/directus.git
synced 2026-04-25 03:00:53 -04:00
Ignore default DB_FILENAME option when using MySQL/MariaDB (#22970)
Co-authored-by: Pascal Jufer <pascal-jufer@bluewin.ch>
This commit is contained in:
5
.changeset/ten-beds-pretend.md
Normal file
5
.changeset/ten-beds-pretend.md
Normal file
@@ -0,0 +1,5 @@
|
||||
---
|
||||
"@directus/api": patch
|
||||
---
|
||||
|
||||
Ensured the default `DB_FILENAME` option from the Docker Image is not applied when using MySQL/MariaDB, fixing a corresponding warning
|
||||
@@ -1,6 +1,7 @@
|
||||
import { useEnv } from '@directus/env';
|
||||
import type { SchemaInspector } from '@directus/schema';
|
||||
import { createInspector } from '@directus/schema';
|
||||
import { isObject } from '@directus/utils';
|
||||
import fse from 'fs-extra';
|
||||
import type { Knex } from 'knex';
|
||||
import knex from 'knex';
|
||||
@@ -136,6 +137,9 @@ export function getDatabase(): Knex {
|
||||
}
|
||||
|
||||
if (client === 'mysql') {
|
||||
// Remove the conflicting `filename` option, defined by default in the Docker Image
|
||||
if (isObject(knexConfig.connection)) delete knexConfig.connection['filename'];
|
||||
|
||||
Object.assign(knexConfig, { client: 'mysql2' });
|
||||
|
||||
poolConfig.afterCreate = async (conn: any, callback: any) => {
|
||||
|
||||
@@ -141,3 +141,4 @@
|
||||
- Dominic-Preap
|
||||
- brandondrew
|
||||
- alantiller
|
||||
- cliqer
|
||||
|
||||
Reference in New Issue
Block a user