-
Notifications
You must be signed in to change notification settings - Fork 426
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add migration to add user_deletion table
- Loading branch information
Showing
1 changed file
with
26 additions
and
0 deletions.
There are no files selected for viewing
26 changes: 26 additions & 0 deletions
26
h/migrations/versions/1671cf35fb34_add_user_deletion_table.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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") |