2021-05-04 00:47:06 +02:00
|
|
|
"""empty message
|
|
|
|
|
|
|
|
Revision ID: 8ee3cf3fb312
|
|
|
|
Revises: e82c2141fae3
|
|
|
|
Create Date: 2021-05-03 22:21:02.167758
|
|
|
|
|
|
|
|
"""
|
|
|
|
from alembic import op
|
2023-05-13 18:53:21 +02:00
|
|
|
from sqlalchemy import text
|
2021-05-04 00:47:06 +02:00
|
|
|
from sqlalchemy.dialects import postgresql
|
|
|
|
|
|
|
|
# revision identifiers, used by Alembic.
|
|
|
|
revision = '8ee3cf3fb312'
|
|
|
|
down_revision = 'e82c2141fae3'
|
|
|
|
branch_labels = None
|
|
|
|
depends_on = None
|
|
|
|
|
|
|
|
|
|
|
|
def upgrade():
|
|
|
|
op.alter_column('user', 'email_confirmed_at',
|
|
|
|
existing_type=postgresql.TIMESTAMP(),
|
|
|
|
nullable=True)
|
2023-05-13 18:53:21 +02:00
|
|
|
op.execute(text("""UPDATE "user" SET email_confirmed_at = NULL WHERE email_confirmed_at < '2016-01-01'::date"""))
|
2021-05-04 00:47:06 +02:00
|
|
|
|
|
|
|
|
|
|
|
def downgrade():
|
|
|
|
op.alter_column('user', 'email_confirmed_at',
|
|
|
|
existing_type=postgresql.TIMESTAMP(),
|
|
|
|
nullable=False)
|
|
|
|
op.execute(
|
2023-05-13 18:53:21 +02:00
|
|
|
text("""UPDATE "user" SET email_confirmed_at = '2004-01-01'::date WHERE email_confirmed_at IS NULL"""))
|