mirror of
https://github.com/outline/outline.git
synced 2025-12-20 10:09:43 -06:00
fix: Allow new DATABASE_ env variables to work with migrations/creation (#10216)
* fix: Allow new DATABASE_ env variables to work with migrations/db creation * Revert
This commit is contained in:
@@ -5,7 +5,7 @@ require("@dotenvx/dotenvx").config({
|
||||
var path = require('path');
|
||||
|
||||
module.exports = {
|
||||
'config': path.resolve('server/config', 'database.json'),
|
||||
'config': path.resolve('server/config', 'database.js'),
|
||||
'migrations-path': path.resolve('server', 'migrations'),
|
||||
'models-path': path.resolve('server', 'models'),
|
||||
}
|
||||
|
||||
23
server/config/database.js
Normal file
23
server/config/database.js
Normal file
@@ -0,0 +1,23 @@
|
||||
const shared = {
|
||||
use_env_variable: process.env.DATABASE_URL ? "DATABASE_URL" : undefined,
|
||||
dialect: "postgres",
|
||||
host: process.env.DATABASE_HOST,
|
||||
port: process.env.DATABASE_PORT || 5432,
|
||||
username: process.env.DATABASE_USER,
|
||||
password: process.env.DATABASE_PASSWORD || undefined,
|
||||
database: process.env.DATABASE_NAME,
|
||||
};
|
||||
|
||||
module.exports = {
|
||||
development: shared,
|
||||
test: shared,
|
||||
"production-ssl-disabled": shared,
|
||||
production: {
|
||||
...shared,
|
||||
dialectOptions: {
|
||||
ssl: {
|
||||
rejectUnauthorized: false,
|
||||
},
|
||||
},
|
||||
},
|
||||
};
|
||||
@@ -1,23 +0,0 @@
|
||||
{
|
||||
"development": {
|
||||
"use_env_variable": "DATABASE_URL",
|
||||
"dialect": "postgres"
|
||||
},
|
||||
"test": {
|
||||
"use_env_variable": "DATABASE_URL",
|
||||
"dialect": "postgres"
|
||||
},
|
||||
"production": {
|
||||
"use_env_variable": "DATABASE_URL",
|
||||
"dialect": "postgres",
|
||||
"dialectOptions": {
|
||||
"ssl": {
|
||||
"rejectUnauthorized": false
|
||||
}
|
||||
}
|
||||
},
|
||||
"production-ssl-disabled": {
|
||||
"use_env_variable": "DATABASE_URL",
|
||||
"dialect": "postgres"
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user