Load the test schema once and truncate data between files.
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
1 parent
3c0213ae74
commit
79e4fd0d4b
8 files changed
+78
-25
No files matched your search
+10
-5
@@ -555,16 +555,21 @@ def _seed_runtime(conn: Any) -> None:
|
||||
seed_generation_instructions(conn)
|
||||
|
||||
|
||||
def refresh_runtime_seed() -> None:
|
||||
"""Re-seed catalog rows after a data truncate. Schema must already exist."""
|
||||
with get_db() as conn:
|
||||
_seed_runtime(conn)
|
||||
from writing_profile_store import bootstrap_from_existing
|
||||
|
||||
bootstrap_from_existing()
|
||||
|
||||
|
||||
def init_db() -> None:
|
||||
if use_postgres():
|
||||
from db_init import ensure_postgres_ready
|
||||
|
||||
ensure_postgres_ready()
|
||||
with get_db() as conn:
|
||||
_seed_runtime(conn)
|
||||
from writing_profile_store import bootstrap_from_existing
|
||||
|
||||
bootstrap_from_existing()
|
||||
refresh_runtime_seed()
|
||||
return
|
||||
|
||||
schema = SCHEMA_PATH.read_text(encoding="utf-8")
|
||||
|
||||
Reference in new issue
Block a user