diff options
| author | Christophe Besson <cbesson@gmail.com> | 2026-08-09 04:35:31 +0200 |
|---|---|---|
| committer | Christophe Besson <cbesson@gmail.com> | 2026-08-09 04:35:31 +0200 |
| commit | 77d76421829161df6b1ef628b4e6e051a2c3c2ee (patch) | |
| tree | 865a3a4044d16a4320981e3cb1efb7128fd8d096 /packages/meshbay-hub/src/meshbay_hub/db/migrations/script.py.mako | |
| parent | d752cd8ebae87bf2e0f5be09307b7fd45f3a60f3 (diff) | |
| download | meshbay-77d76421829161df6b1ef628b4e6e051a2c3c2ee.tar.gz | |
feat(hub): add SQLAlchemy 2.0 async DB layer + Alembic
Models: User, Node, Group, GroupMember, GEKBundle, RefreshToken, IPLog.
Engine configurable via MESHBAY_DATABASE_URL (asyncpg/aiosqlite).
Alembic async env.py + initial_schema migration autogenerated.
Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
Diffstat (limited to 'packages/meshbay-hub/src/meshbay_hub/db/migrations/script.py.mako')
| -rw-r--r-- | packages/meshbay-hub/src/meshbay_hub/db/migrations/script.py.mako | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/packages/meshbay-hub/src/meshbay_hub/db/migrations/script.py.mako b/packages/meshbay-hub/src/meshbay_hub/db/migrations/script.py.mako new file mode 100644 index 0000000..1101630 --- /dev/null +++ b/packages/meshbay-hub/src/meshbay_hub/db/migrations/script.py.mako @@ -0,0 +1,28 @@ +"""${message} + +Revision ID: ${up_revision} +Revises: ${down_revision | comma,n} +Create Date: ${create_date} + +""" +from typing import Sequence, Union + +from alembic import op +import sqlalchemy as sa +${imports if imports else ""} + +# revision identifiers, used by Alembic. +revision: str = ${repr(up_revision)} +down_revision: Union[str, Sequence[str], None] = ${repr(down_revision)} +branch_labels: Union[str, Sequence[str], None] = ${repr(branch_labels)} +depends_on: Union[str, Sequence[str], None] = ${repr(depends_on)} + + +def upgrade() -> None: + """Upgrade schema.""" + ${upgrades if upgrades else "pass"} + + +def downgrade() -> None: + """Downgrade schema.""" + ${downgrades if downgrades else "pass"} |