Advertisement
Mochinov

Untitled

Nov 24th, 2023
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.00 KB | None | 0 0
  1. def upgrade():
  2. # ### commands auto generated by Alembic - please adjust! ###
  3. op.add_column(
  4. 'company',
  5. sa.Column('verification_status', sa.String(length=128), nullable=True)
  6. )
  7. op.alter_column(
  8. 'company',
  9. 'address',
  10. existing_type=sa.VARCHAR(length=255),
  11. type_=sa.JSON(astext_type=sa.Text(), none_as_null=True),
  12. existing_nullable=True,
  13. postgresql_using='address::json' # Specify the USING clause for PostgreSQL
  14. )
  15. # ### end Alembic commands ###
  16.  
  17. def downgrade():
  18. # ### commands auto generated by Alembic - please adjust! ###
  19. op.alter_column(
  20. 'company',
  21. 'address',
  22. existing_type=sa.JSON(astext_type=sa.Text(), none_as_null=True),
  23. type_=sa.VARCHAR(length=255),
  24. existing_nullable=True,
  25. postgresql_using='address::varchar' # Specify the USING clause for PostgreSQL
  26. )
  27. op.drop_column('company', 'verification_status')
  28. # ### end Alembic commands ###
  29.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement