doneth.at/migrations/versions/cd3b1ad8c50b_add_accomplish...

37 lines
999 B
Python

"""Add Accomplishement model
Revision ID: cd3b1ad8c50b
Revises: 8b55f5add4f1
Create Date: 2020-08-29 14:20:28.454292
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = 'cd3b1ad8c50b'
down_revision = '8b55f5add4f1'
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.create_table('accomplishment',
sa.Column('id', sa.Integer(), nullable=False),
sa.Column('user_id', sa.Integer(), nullable=False),
sa.Column('time', sa.DateTime(), nullable=False),
sa.Column('text', sa.String(length=128), nullable=False),
sa.Column('difficulty', sa.Integer(), nullable=True),
sa.ForeignKeyConstraint(['user_id'], ['user.id'], ),
sa.PrimaryKeyConstraint('id')
)
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.drop_table('accomplishment')
# ### end Alembic commands ###