Skip to content

Commit

Permalink
Add migration to add user.pubid column
Browse files Browse the repository at this point in the history
  • Loading branch information
mtomilov committed Jan 14, 2025
1 parent dac0c3f commit 39a83dc
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions h/migrations/versions/3bae642f2b36_add_pubid_to_user.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
"""Add pubid to user."""

import sqlalchemy as sa
from alembic import op

revision = "3bae642f2b36"
down_revision = "9c0efdf762a6"


def upgrade():
op.add_column("user", sa.Column("pubid", sa.Text(), nullable=True))
op.create_unique_constraint(op.f("uq__user__pubid"), "user", ["pubid"])


def downgrade():
op.drop_constraint(op.f("uq__user__pubid"), "user", type_="unique")
op.drop_column("user", "pubid")

0 comments on commit 39a83dc

Please sign in to comment.