feat(projects): automate project infrastructure provisioning
This commit is contained in:
@@ -62,12 +62,18 @@ def get_project_database_name(name: str) -> str:
|
||||
|
||||
|
||||
def get_project_template_database_name(name: str | None = None) -> str:
|
||||
"""Return the configured immutable template for the WNDB schema version.
|
||||
"""Return the network-data template paired with one physical BizDB.
|
||||
|
||||
The template belongs to the database schema version, not to an individual
|
||||
logical project or its temporary physical database name.
|
||||
Project routing is resolved before the suffix is applied, so a logical
|
||||
project such as ``tjwater_v2`` uses ``tjwater_v2_template``.
|
||||
"""
|
||||
return settings.WNDB_TEMPLATE_DB_NAME
|
||||
database_name = get_project_database_name(name or settings.DB_NAME)
|
||||
return f"{database_name}_template"
|
||||
|
||||
|
||||
def get_schema_template_database_name() -> str:
|
||||
"""Return the immutable, data-free template used to create BizDB schemas."""
|
||||
return settings.WNDB_SCHEMA_TEMPLATE_DB_NAME
|
||||
|
||||
|
||||
def get_project_pgconn_string(db_name: str | None = None) -> str:
|
||||
|
||||
Reference in New Issue
Block a user