ebd87de4edcc_init.py 936 B

123456789101112131415161718192021222324252627282930313233343536
  1. """init
  2. Revision ID: ebd87de4edcc
  3. Revises: 68260864aa47
  4. Create Date: 2020-03-28 15:21:00.743680
  5. """
  6. from alembic import op
  7. import sqlalchemy as sa
  8. # revision identifiers, used by Alembic.
  9. revision = 'ebd87de4edcc'
  10. down_revision = '68260864aa47'
  11. branch_labels = None
  12. depends_on = None
  13. def upgrade():
  14. # ### commands auto generated by Alembic - please adjust! ###
  15. op.create_table('users',
  16. sa.Column('user_id', sa.Integer(), nullable=False),
  17. sa.Column('class_', sa.Integer(), nullable=True),
  18. sa.Column('subject', sa.String(), nullable=True),
  19. sa.PrimaryKeyConstraint('user_id')
  20. )
  21. op.create_index(op.f('ix_users_user_id'), 'users', ['user_id'], unique=True)
  22. # ### end Alembic commands ###
  23. def downgrade():
  24. # ### commands auto generated by Alembic - please adjust! ###
  25. op.drop_index(op.f('ix_users_user_id'), table_name='users')
  26. op.drop_table('users')
  27. # ### end Alembic commands ###