Remove crippling downgrade code

This commit is contained in:
Midgard 2020-01-27 22:03:15 +01:00
parent 5049382bf1
commit 85f36a8fe4
Signed by: midgard
GPG key ID: 511C112F1331BBB4

View file

@ -140,38 +140,3 @@ def upgrade():
def downgrade():
raise NotImplementedError("Downgrading to before HLDS is not supported")
# Don't use this. It will cripple the data.
op.alter_column("order", "courier_id", new_column_name="courrier_id", type_=sa.Integer)
op.alter_column("order_item", "comment", new_column_name="extra",
existing_type=sa.Text(), type_=sa.String(254))
op.alter_column("order_item", "user_name", new_column_name="name", type_=sa.String(120))
# ### commands auto generated by Alembic - please adjust! ###
op.add_column("order_item", sa.Column("product_id", sa.INTEGER(), nullable=True))
op.create_foreign_key(None, "order_item", "product", ["product_id"], ["id"])
op.drop_column("order_item", "price")
op.drop_column("order_item", "hlds_data_version")
op.drop_column("order_item", "dish_name")
op.drop_column("order_item", "dish_id")
op.create_foreign_key(None, "order", "location", ["location_id"], ["id"])
op.drop_column("order", "location_name")
op.create_table("location",
sa.Column("id", sa.INTEGER(), nullable=False),
sa.Column("name", sa.VARCHAR(length=120), nullable=False),
sa.Column("address", sa.VARCHAR(length=254), nullable=True),
sa.Column("website", sa.VARCHAR(length=120), nullable=True),
sa.Column("telephone", sa.VARCHAR(length=20), nullable=True),
sa.PrimaryKeyConstraint("id")
)
op.create_table("product",
sa.Column("id", sa.INTEGER(), nullable=False),
sa.Column("location_id", sa.INTEGER(), nullable=True),
sa.Column("name", sa.VARCHAR(length=120), nullable=False),
sa.Column("price", sa.INTEGER(), nullable=False),
sa.ForeignKeyConstraint(["location_id"], ["location.id"], ),
sa.PrimaryKeyConstraint("id")
)
op.drop_table("order_item_choice")
# ### end Alembic commands ###