Add telegram_communication app with dedicated DB routing
Gitea Actions Demo / Explore-Gitea-Actions (push) Successful in 3s
Gitea Actions Demo / Explore-Gitea-Actions (push) Successful in 3s
- Register TelegramCommunicationConfig in INSTALLED_APPS and add telegram_db to DATABASES - Define TelegramData model mapped to the messages table - Fix allow_migrate in ProjectDatabaseRouter: redirect and telegram entries were returning the DB name string (always truthy) instead of a boolean comparison, causing their migrations to bleed into every database - Add telegram routing to db_for_read, db_for_write, allow_relation, and allow_migrate Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -47,6 +47,7 @@ INSTALLED_APPS = [
|
||||
'apps.random_simpsons.apps.RandomSimpsonsConfig',
|
||||
'apps.website_redirection.apps.redirectConfig',
|
||||
'apps.job_dashboard.apps.JobDashboardConfig',
|
||||
'apps.telegram_communication.apps.TelegramCommunicationConfig',
|
||||
'import_export',
|
||||
]
|
||||
|
||||
@@ -133,6 +134,14 @@ DATABASES = {
|
||||
'HOST': os.environ.get('DB_HOST'),
|
||||
'PORT': os.environ.get('DB_PORT'),
|
||||
},
|
||||
'telegram_db': {
|
||||
'ENGINE': 'django.db.backends.postgresql',
|
||||
'NAME': 'telegram',
|
||||
'USER': os.environ.get('DB_USERNAME'),
|
||||
'PASSWORD': os.environ.get('DB_PASSWORD'),
|
||||
'HOST': os.environ.get('DB_HOST'),
|
||||
'PORT': os.environ.get('DB_PORT'),
|
||||
},
|
||||
}
|
||||
DATABASE_ROUTERS = ['core.routers.ProjectDatabaseRouter']
|
||||
#DATABASE_ROUTERS = []
|
||||
|
||||
Reference in New Issue
Block a user