diff options
Diffstat (limited to 'packages/meshbay-hub/src/meshbay_hub/db/migrations')
| -rw-r--r-- | packages/meshbay-hub/src/meshbay_hub/db/migrations/versions/b1c2d3e4f5a6_add_hub_settings.py | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/packages/meshbay-hub/src/meshbay_hub/db/migrations/versions/b1c2d3e4f5a6_add_hub_settings.py b/packages/meshbay-hub/src/meshbay_hub/db/migrations/versions/b1c2d3e4f5a6_add_hub_settings.py new file mode 100644 index 0000000..13f2b5c --- /dev/null +++ b/packages/meshbay-hub/src/meshbay_hub/db/migrations/versions/b1c2d3e4f5a6_add_hub_settings.py @@ -0,0 +1,34 @@ +"""add_hub_settings + +Revision ID: b1c2d3e4f5a6 +Revises: a7b8c9d0e1f2 +Create Date: 2026-08-28 12:00:00.000000 + +""" +from typing import Sequence, Union + +from alembic import op +import sqlalchemy as sa + + +revision: str = 'b1c2d3e4f5a6' +down_revision: Union[str, Sequence[str], None] = 'a7b8c9d0e1f2' +branch_labels: Union[str, Sequence[str], None] = None +depends_on: Union[str, Sequence[str], None] = None + + +def upgrade() -> None: + op.create_table( + 'hub_settings', + sa.Column('key', sa.String(64), nullable=False), + sa.Column('value', sa.Text(), nullable=False), + sa.Column('updated_at', sa.DateTime(timezone=True), + server_default=sa.func.now(), nullable=False), + sa.PrimaryKeyConstraint('key'), + ) + # No seed rows: an absent key is the default, and writing "true" here would + # make a later change of default invisible to an already-migrated hub. + + +def downgrade() -> None: + op.drop_table('hub_settings') |