Skip to content

Commit

Permalink
Add migration to add user_deletion table
Browse files Browse the repository at this point in the history
  • Loading branch information
seanh committed May 23, 2024
1 parent a3821ee commit ffd1133
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions h/migrations/versions/1671cf35fb34_add_user_deletion_table.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
"""Add user_deletion table."""

from alembic import op
from sqlalchemy import Column, DateTime, Integer, String, text

revision = "1671cf35fb34"
down_revision = "857c71c8f5f3"


def upgrade():
op.create_table(
"user_deletion",
Column("id", Integer(), primary_key=True, autoincrement=True, nullable=False),
Column("userid", String(), nullable=False),
Column(
"requested_at", DateTime(), server_default=text("now()"), nullable=False
),
Column("requested_by", String(), nullable=False),
Column("tag", String(), nullable=False),
Column("registered_date", DateTime(), nullable=False),
Column("num_annotations", Integer(), nullable=False),
)


def downgrade():
op.drop_table("user_deletion")

0 comments on commit ffd1133

Please sign in to comment.