Specify database name

This commit is contained in:
Oliver Walters 2021-03-31 21:48:54 +11:00
parent 566c3af39e
commit 82b6c48946
4 changed files with 6 additions and 7 deletions

View File

@ -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'

View File

@ -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'

View File

@ -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'

View File

@ -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