app/migrations/versions/2020_051515_5cad8fa84386_.py

46 lines
1.2 KiB
Python
Raw Normal View History

"""empty message
Revision ID: 5cad8fa84386
Revises: a5e3c6693dc6
Create Date: 2020-05-15 15:10:00.096349
"""
import sqlalchemy_utils
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = "5cad8fa84386"
2020-05-17 02:44:06 +08:00
down_revision = "552d735a2f1f"
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.alter_column("users", "use_via_format_for_sender", server_default=None)
op.alter_column(
"users",
"use_via_format_for_sender",
new_column_name="sender_format",
type_=sa.Integer(),
postgresql_using="use_via_format_for_sender::integer",
)
op.alter_column("users", "sender_format", server_default="1")
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.alter_column("users", "sender_format", server_default=None)
op.alter_column(
"users",
"sender_format",
new_column_name="use_via_format_for_sender",
type_=sa.Boolean(),
postgresql_using="sender_format::boolean",
)
op.alter_column("users", "use_via_format_for_sender", server_default="1")
# ### end Alembic commands ###