2023020440_init_user_model_07c71f4389b6.py 990 B

12345678910111213141516171819202122232425262728293031323334353637
  1. """init_user_model
  2. Revision ID: 07c71f4389b6
  3. Revises:
  4. Create Date: 2023-02-04 23:40:00.426237
  5. """
  6. import sqlalchemy as sa
  7. from alembic import op
  8. # revision identifiers, used by Alembic.
  9. revision = "07c71f4389b6"
  10. down_revision = None
  11. branch_labels = None
  12. depends_on = None
  13. def upgrade():
  14. # ### commands auto generated by Alembic - please adjust! ###
  15. op.create_table(
  16. "user_model",
  17. sa.Column("id", sa.UUID(), nullable=False),
  18. sa.Column("email", sa.String(length=254), nullable=False),
  19. sa.Column("hashed_password", sa.String(length=128), nullable=False),
  20. sa.PrimaryKeyConstraint("id"),
  21. )
  22. op.create_index(op.f("ix_user_model_email"), "user_model", ["email"], unique=True)
  23. # ### end Alembic commands ###
  24. def downgrade():
  25. # ### commands auto generated by Alembic - please adjust! ###
  26. op.drop_index(op.f("ix_user_model_email"), table_name="user_model")
  27. op.drop_table("user_model")
  28. # ### end Alembic commands ###