Compare commits

...

6 Commits
d-x ... update

Author SHA1 Message Date
Faruk AYDIN
caffea49ce docs: Add postgres schema to the environment variables 2023-04-17 14:52:19 +02:00
Faruk AYDIN
272bd9dc62 feat: Use postgres schema instead of database schema 2023-04-17 14:52:19 +02:00
Faruk AYDIN
a4e7824109 chore: No need to specify schema in .env-example file 2023-04-17 14:52:19 +02:00
Shehab Ghazy
5ed7fc8b7c Update .env-example 2023-04-17 14:52:19 +02:00
Shehab Ghazy
c4d4b2a2a8 Update knexfile.ts 2023-04-17 14:52:19 +02:00
Shehab Ghazy
47212c37c2 honor schema from env 2023-04-17 14:52:19 +02:00
3 changed files with 4 additions and 0 deletions

View File

@@ -12,6 +12,7 @@ const knexConfig = {
database: appConfig.postgresDatabase,
ssl: appConfig.postgresEnableSsl,
},
searchPath: [appConfig.postgresSchema],
pool: { min: 0, max: 20 },
migrations: {
directory: __dirname + '/src/db/migrations',

View File

@@ -11,6 +11,7 @@ type AppConfig = {
appEnv: string;
isDev: boolean;
postgresDatabase: string;
postgresSchema: string;
postgresPort: number;
postgresHost: string;
postgresUsername: string;
@@ -81,6 +82,7 @@ const appConfig: AppConfig = {
isDev: appEnv === 'development',
version: process.env.npm_package_version,
postgresDatabase: process.env.POSTGRES_DATABASE || 'automatisch_development',
postgresSchema: process.env.POSTGRES_SCHEMA || 'public',
postgresPort: parseInt(process.env.POSTGRES_PORT || '5432'),
postgresHost: process.env.POSTGRES_HOST || 'localhost',
postgresUsername:

View File

@@ -23,6 +23,7 @@ Please be careful with the `ENCRYPTION_KEY` and `WEBHOOK_SECRET_KEY` environment
| `WEB_APP_URL` | string | | Can be used to override connection URLs and CORS URL |
| `WEBHOOK_URL` | string | | Can be used to override webhook URL |
| `POSTGRES_DATABASE` | string | `automatisch` | Database Name |
| `POSTGRES_SCHEMA` | string | `public` | Database Schema |
| `POSTGRES_PORT` | number | `5432` | Database Port |
| `POSTGRES_HOST` | string | `postgres` | Database Host |
| `POSTGRES_USERNAME` | string | `automatisch_user` | Database User |