Spaces:
Runtime error
Runtime error
Disable PostgreSQL ORM auto-creation at startup (#10)
Browse files- Disable PostgreSQL ORM auto-creation at startup (abc82adc08567933a51cee1b8f10932edbd1815f)
- app/container.py +4 -3
app/container.py
CHANGED
|
@@ -124,9 +124,10 @@ class Container:
|
|
| 124 |
notifications: NotificationService
|
| 125 |
|
| 126 |
def build_container(settings: Settings) -> Container:
|
| 127 |
-
#
|
| 128 |
-
#
|
| 129 |
-
|
|
|
|
| 130 |
tenants = TenantService(security_database)
|
| 131 |
assets = CanonicalAssetService(security_database, settings)
|
| 132 |
api_keys = APIKeyService(security_database, settings, tenants)
|
|
|
|
| 124 |
notifications: NotificationService
|
| 125 |
|
| 126 |
def build_container(settings: Settings) -> Container:
|
| 127 |
+
# SQLite retains local-development metadata creation through SecurityDatabase's
|
| 128 |
+
# SQLite-specific default. PostgreSQL is migration-only; never run create_all
|
| 129 |
+
# during production startup.
|
| 130 |
+
security_database = SecurityDatabase(settings.database_url)
|
| 131 |
tenants = TenantService(security_database)
|
| 132 |
assets = CanonicalAssetService(security_database, settings)
|
| 133 |
api_keys = APIKeyService(security_database, settings, tenants)
|