fix: correct Strapi database configuration structure
The database config had an incorrect nested structure with connection.client.connection which caused Strapi to fail with 'Cannot destructure property client of db.config.connection'. Fixed to use the correct flat structure: connection.client, connection.host, etc.
This commit is contained in:
parent
0ef26ba2f1
commit
590a96e502
@ -11,15 +11,13 @@ export default ({ env }) => {
|
||||
if (client === 'postgres') {
|
||||
return {
|
||||
connection: {
|
||||
client,
|
||||
connection: {
|
||||
host: env('DATABASE_HOST', 'localhost'),
|
||||
port: env.int('DATABASE_PORT', 5432),
|
||||
database: env('DATABASE_NAME', 'strapi'),
|
||||
user: env('DATABASE_USERNAME', 'strapi'),
|
||||
password: env('DATABASE_PASSWORD', 'strapi'),
|
||||
ssl: env.bool('DATABASE_SSL', false),
|
||||
},
|
||||
client: 'postgres',
|
||||
host: env('DATABASE_HOST', 'localhost'),
|
||||
port: env.int('DATABASE_PORT', 5432),
|
||||
database: env('DATABASE_NAME', 'strapi'),
|
||||
user: env('DATABASE_USERNAME', 'strapi'),
|
||||
password: env('DATABASE_PASSWORD', 'strapi'),
|
||||
ssl: env.bool('DATABASE_SSL', false),
|
||||
pool: { min: 2, max: 10 },
|
||||
},
|
||||
};
|
||||
@ -27,10 +25,8 @@ export default ({ env }) => {
|
||||
|
||||
return {
|
||||
connection: {
|
||||
client,
|
||||
connection: {
|
||||
filename: path.join(__dirname, '..', '..', env('DATABASE_FILENAME', '.tmp/data.db')),
|
||||
},
|
||||
client: 'sqlite',
|
||||
filename: path.join(__dirname, '..', '..', env('DATABASE_FILENAME', '.tmp/data.db')),
|
||||
useNullAsDefault: true,
|
||||
},
|
||||
};
|
||||
|
||||
Loading…
Reference in New Issue
Block a user