Add created_at to User and UserEmailVerification
This commit is contained in:
28
migrations/versions/96a01fe23389_.py
Normal file
28
migrations/versions/96a01fe23389_.py
Normal file
@@ -0,0 +1,28 @@
|
||||
"""empty message
|
||||
|
||||
Revision ID: 96a01fe23389
|
||||
Revises: cd5ab8a01f4a
|
||||
Create Date: 2021-11-24 17:12:33.893988
|
||||
|
||||
"""
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
from sqlalchemy.dialects import postgresql
|
||||
|
||||
# revision identifiers, used by Alembic.
|
||||
revision = '96a01fe23389'
|
||||
down_revision = 'cd5ab8a01f4a'
|
||||
branch_labels = None
|
||||
depends_on = None
|
||||
|
||||
|
||||
def upgrade():
|
||||
op.execute("DELETE FROM user_email_verification")
|
||||
op.add_column('user', sa.Column('created_at', sa.DateTime(), nullable=True))
|
||||
op.add_column('user_email_verification', sa.Column('created_at', sa.DateTime(), nullable=False))
|
||||
|
||||
|
||||
def downgrade():
|
||||
|
||||
op.drop_column('user_email_verification', 'created_at')
|
||||
op.drop_column('user', 'created_at')
|
||||
Reference in New Issue
Block a user