35 lines
628 B
JavaScript
35 lines
628 B
JavaScript
require('dotenv').config();
|
|
|
|
const databaseUrl = process.env.DATABASE_URL;
|
|
|
|
if (!databaseUrl) {
|
|
console.warn('DATABASE_URL is not set. Migrations need a configured MySQL/MariaDB database.');
|
|
}
|
|
|
|
module.exports = {
|
|
development: {
|
|
client: 'mysql2',
|
|
connection: databaseUrl,
|
|
migrations: {
|
|
directory: './src/db/migrations',
|
|
extension: 'js'
|
|
},
|
|
pool: {
|
|
min: 0,
|
|
max: 10
|
|
}
|
|
},
|
|
production: {
|
|
client: 'mysql2',
|
|
connection: databaseUrl,
|
|
migrations: {
|
|
directory: './src/db/migrations',
|
|
extension: 'js'
|
|
},
|
|
pool: {
|
|
min: 2,
|
|
max: 20
|
|
}
|
|
}
|
|
};
|