Package Postgres migrations with user-engine
This commit is contained in:
parent
2869c1030d
commit
c27012afe5
4 changed files with 71 additions and 10 deletions
|
|
@ -9,7 +9,7 @@ from __future__ import annotations
|
|||
|
||||
import json
|
||||
from contextlib import contextmanager
|
||||
from pathlib import Path
|
||||
from importlib.resources import files
|
||||
from typing import Any, Iterable, Iterator, Mapping, Protocol, cast
|
||||
|
||||
from user_engine.domain import (
|
||||
|
|
@ -624,9 +624,10 @@ def _first_column(row: Any) -> Any:
|
|||
|
||||
|
||||
def _load_bootstrap_sql() -> str:
|
||||
repo_root = Path(__file__).resolve().parents[3]
|
||||
return (repo_root / "migrations/postgres/0001_user_engine_store.sql").read_text(
|
||||
encoding="utf-8"
|
||||
return (
|
||||
files("user_engine")
|
||||
.joinpath("migrations/postgres/0001_user_engine_store.sql")
|
||||
.read_text(encoding="utf-8")
|
||||
)
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue