Digitale bierlijst

cca57457a0a6_add_aardbei_fields.py 831B

12345678910111213141516171819202122232425262728293031
  1. """Add Aardbei fields
  2. Revision ID: cca57457a0a6
  3. Revises: 2f3a49058a67
  4. Create Date: 2019-09-05 21:38:28.489281
  5. """
  6. from alembic import op
  7. import sqlalchemy as sa
  8. # revision identifiers, used by Alembic.
  9. revision = "cca57457a0a6"
  10. down_revision = "2f3a49058a67"
  11. branch_labels = None
  12. depends_on = None
  13. def upgrade():
  14. with op.batch_alter_table("people") as batch_op:
  15. batch_op.alter_column("name", new_column_name="full_name")
  16. batch_op.add_column(sa.Column("aardbei_id", sa.Integer(), nullable=True))
  17. batch_op.add_column(sa.Column("display_name", sa.String(), nullable=True))
  18. def downgrade():
  19. with op.batch_alter_table("people") as batch_op:
  20. batch_op.alter_column("full_name", new_column_name="name")
  21. batch_op.drop_column("aardbei_id")
  22. batch_op.drop_column("display_name")