mirror of
https://github.com/inventree/InvenTree
synced 2024-08-30 18:33:04 +00:00
Specify database name
This commit is contained in:
parent
566c3af39e
commit
82b6c48946
1
.github/workflows/mariadb.yaml
vendored
1
.github/workflows/mariadb.yaml
vendored
@ -10,6 +10,7 @@ jobs:
|
||||
env:
|
||||
# Database backend configuration
|
||||
INVENTREE_DB_ENGINE: django.db.backends.mysql
|
||||
INVENTREE_DB_NAME: inventree
|
||||
INVENTREE_DB_USER: root
|
||||
INVENTREE_DB_PASSWORD: password
|
||||
INVENTREE_DB_HOST: '127.0.0.1'
|
||||
|
1
.github/workflows/mysql.yaml
vendored
1
.github/workflows/mysql.yaml
vendored
@ -12,6 +12,7 @@ jobs:
|
||||
env:
|
||||
# Database backend configuration
|
||||
INVENTREE_DB_ENGINE: django.db.backends.mysql
|
||||
INVENTREE_DB_NAME: inventree
|
||||
INVENTREE_DB_USER: root
|
||||
INVENTREE_DB_PASSWORD: password
|
||||
INVENTREE_DB_HOST: '127.0.0.1'
|
||||
|
1
.github/workflows/postgresql.yaml
vendored
1
.github/workflows/postgresql.yaml
vendored
@ -12,6 +12,7 @@ jobs:
|
||||
env:
|
||||
# Database backend configuration
|
||||
INVENTREE_DB_ENGINE: django.db.backends.postgresql
|
||||
INVENTREE_DB_NAME: inventree
|
||||
INVENTREE_DB_USER: inventree
|
||||
INVENTREE_DB_PASSWORD: password
|
||||
INVENTREE_DB_HOST: '127.0.0.1'
|
||||
|
@ -333,10 +333,6 @@ db_config = CONFIG.get('database', {})
|
||||
|
||||
# Environment variables take preference over config file!
|
||||
|
||||
# If a particular database option is not specified in the config file,
|
||||
# look for it in the environmental variables
|
||||
# e.g. INVENTREE_DB_NAME / INVENTREE_DB_USER / etc
|
||||
|
||||
db_keys = ['ENGINE', 'NAME', 'USER', 'PASSWORD', 'HOST', 'PORT']
|
||||
|
||||
for key in db_keys:
|
||||
@ -380,9 +376,9 @@ db_host = db_config.get('HOST', "''")
|
||||
|
||||
print("InvenTree Database Configuration")
|
||||
print("================================")
|
||||
print(f"INVENTREE_DB_ENGINE: {db_engine}")
|
||||
print(f"INVENTREE_DB_NAME: {db_name}")
|
||||
print(f"INVENTREE_DB_HOST: {db_host}")
|
||||
print(f"ENGINE: {db_engine}")
|
||||
print(f"NAME: {db_name}")
|
||||
print(f"HOST: {db_host}")
|
||||
|
||||
DATABASES['default'] = db_config
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user