Fixed™ enums, so I can finally modify them
parent
82e5c449bb
commit
c0efbc96cd
@ -1,47 +0,0 @@
|
||||
"""empty message
|
||||
|
||||
Revision ID: b1a3eed8e38f
|
||||
Revises: f4e1b4727000
|
||||
Create Date: 2020-03-09 23:58:53.716242
|
||||
|
||||
"""
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
import sqlalchemy_utc
|
||||
|
||||
|
||||
# revision identifiers, used by Alembic.
|
||||
revision = 'b1a3eed8e38f'
|
||||
down_revision = 'f4e1b4727000'
|
||||
branch_labels = None
|
||||
depends_on = None
|
||||
|
||||
|
||||
def upgrade():
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
op.create_table('user_tags_blacklist',
|
||||
sa.Column('user_id', sa.Integer(), nullable=True),
|
||||
sa.Column('tag_id', sa.Integer(), nullable=True),
|
||||
sa.ForeignKeyConstraint(['tag_id'], ['tag.id'], ),
|
||||
sa.ForeignKeyConstraint(['user_id'], ['user.id'], )
|
||||
)
|
||||
op.add_column('user', sa.Column('ban_reason', sa.String(length=512), nullable=True))
|
||||
op.add_column('user', sa.Column('ban_until', sqlalchemy_utc.sqltypes.UtcDateTime(timezone=True), nullable=True))
|
||||
op.add_column('user', sa.Column('biography', sa.String(length=512), nullable=True))
|
||||
op.add_column('user', sa.Column('rating', sa.Enum('safe', 'questionable', 'explicit', name='rating'), server_default='safe', nullable=False))
|
||||
|
||||
op.alter_column('user', 'op_level', server_default='user')
|
||||
op.alter_column('user', 'user_status', server_default='active')
|
||||
op.alter_column('post', 'status', server_default='pending')
|
||||
op.alter_column('tag', 'category', server_default='general')
|
||||
# ### end Alembic commands ###
|
||||
|
||||
|
||||
def downgrade():
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
op.drop_column('user', 'rating')
|
||||
op.drop_column('user', 'biography')
|
||||
op.drop_column('user', 'ban_until')
|
||||
op.drop_column('user', 'ban_reason')
|
||||
op.drop_table('user_tags_blacklist')
|
||||
# ### end Alembic commands ###
|
Loading…
Reference in New Issue