mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 01:56:46 +00:00
Add custom Postgres schema support
This commit is contained in:
@@ -166,6 +166,7 @@ docker run -it --rm \
|
|||||||
-e DB_POSTGRESDB_HOST=<POSTGRES_HOST> \
|
-e DB_POSTGRESDB_HOST=<POSTGRES_HOST> \
|
||||||
-e DB_POSTGRESDB_PORT=<POSTGRES_PORT> \
|
-e DB_POSTGRESDB_PORT=<POSTGRES_PORT> \
|
||||||
-e DB_POSTGRESDB_USER=<POSTGRES_USER> \
|
-e DB_POSTGRESDB_USER=<POSTGRES_USER> \
|
||||||
|
-e DB_POSTGRESDB_SCHEMA=<POSTGRES_SCHEMA> \
|
||||||
-e DB_POSTGRESDB_PASSWORD=<POSTGRES_PASSWORD> \
|
-e DB_POSTGRESDB_PASSWORD=<POSTGRES_PASSWORD> \
|
||||||
-v ~/.n8n:/root/.n8n \
|
-v ~/.n8n:/root/.n8n \
|
||||||
n8nio/n8n \
|
n8nio/n8n \
|
||||||
@@ -214,6 +215,7 @@ The following environment variables support file input:
|
|||||||
- DB_POSTGRESDB_PASSWORD_FILE
|
- DB_POSTGRESDB_PASSWORD_FILE
|
||||||
- DB_POSTGRESDB_PORT_FILE
|
- DB_POSTGRESDB_PORT_FILE
|
||||||
- DB_POSTGRESDB_USER_FILE
|
- DB_POSTGRESDB_USER_FILE
|
||||||
|
- DB_POSTGRESDB_SCHEMA_FILE
|
||||||
- N8N_BASIC_AUTH_PASSWORD_FILE
|
- N8N_BASIC_AUTH_PASSWORD_FILE
|
||||||
- N8N_BASIC_AUTH_USER_FILE
|
- N8N_BASIC_AUTH_USER_FILE
|
||||||
|
|
||||||
|
|||||||
@@ -38,6 +38,7 @@ To use PostgresDB as database you can provide the following environment variable
|
|||||||
- `DB_POSTGRESDB_PORT` (default: 5432)
|
- `DB_POSTGRESDB_PORT` (default: 5432)
|
||||||
- `DB_POSTGRESDB_USER` (default: 'root')
|
- `DB_POSTGRESDB_USER` (default: 'root')
|
||||||
- `DB_POSTGRESDB_PASSWORD` (default: empty)
|
- `DB_POSTGRESDB_PASSWORD` (default: empty)
|
||||||
|
- `DB_POSTGRESDB_SCHEMA` (default: 'public')
|
||||||
|
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
@@ -47,6 +48,7 @@ export DB_POSTGRESDB_HOST=postgresdb
|
|||||||
export DB_POSTGRESDB_PORT=5432
|
export DB_POSTGRESDB_PORT=5432
|
||||||
export DB_POSTGRESDB_USER=n8n
|
export DB_POSTGRESDB_USER=n8n
|
||||||
export DB_POSTGRESDB_PASSWORD=n8n
|
export DB_POSTGRESDB_PASSWORD=n8n
|
||||||
|
export DB_POSTGRESDB_SCHEMA=n8n
|
||||||
|
|
||||||
n8n start
|
n8n start
|
||||||
```
|
```
|
||||||
|
|||||||
@@ -13,5 +13,6 @@ The following environment variables support file input:
|
|||||||
- DB_POSTGRESDB_PASSWORD_FILE
|
- DB_POSTGRESDB_PASSWORD_FILE
|
||||||
- DB_POSTGRESDB_PORT_FILE
|
- DB_POSTGRESDB_PORT_FILE
|
||||||
- DB_POSTGRESDB_USER_FILE
|
- DB_POSTGRESDB_USER_FILE
|
||||||
|
- DB_POSTGRESDB_SCHEMA_FILE
|
||||||
- N8N_BASIC_AUTH_PASSWORD_FILE
|
- N8N_BASIC_AUTH_PASSWORD_FILE
|
||||||
- N8N_BASIC_AUTH_USER_FILE
|
- N8N_BASIC_AUTH_USER_FILE
|
||||||
|
|||||||
@@ -51,6 +51,12 @@ const config = convict({
|
|||||||
default: 'root',
|
default: 'root',
|
||||||
env: 'DB_POSTGRESDB_USER'
|
env: 'DB_POSTGRESDB_USER'
|
||||||
},
|
},
|
||||||
|
schema: {
|
||||||
|
doc: 'PostgresDB Schema',
|
||||||
|
format: String,
|
||||||
|
default: 'public',
|
||||||
|
env: 'DB_POSTGRESDB_SCHEMA'
|
||||||
|
},
|
||||||
},
|
},
|
||||||
mysqldb: {
|
mysqldb: {
|
||||||
database: {
|
database: {
|
||||||
|
|||||||
@@ -57,6 +57,7 @@ export async function init(synchronize?: boolean): Promise<IDatabaseCollections>
|
|||||||
password: await GenericHelpers.getConfigValue('database.postgresdb.password') as string,
|
password: await GenericHelpers.getConfigValue('database.postgresdb.password') as string,
|
||||||
port: await GenericHelpers.getConfigValue('database.postgresdb.port') as number,
|
port: await GenericHelpers.getConfigValue('database.postgresdb.port') as number,
|
||||||
username: await GenericHelpers.getConfigValue('database.postgresdb.user') as string,
|
username: await GenericHelpers.getConfigValue('database.postgresdb.user') as string,
|
||||||
|
schema: await GenericHelpers.getConfigValue('database.postgresdb.schema') as string,
|
||||||
};
|
};
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user