-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Change type and name of basket field on AbstractOrder
It used to be a PositiveIntegerField containing the primary key of the basket. This was a minor design deficiency; a nullable ForeignKey field seems like the correct way to model that relation. It's also been renamed from basket_id to basket to reflect the change. Migrations unfortunately are non-trivial: * 0019 adds the new ForeignKey field, but called basket_alt * 0020 migrates data from the old field to the new field * 0021 drops the now unnecessary field basket_id * 0022 renames the basket_alt field to basket The additional step with naming it basket_alt is necessary because of a column name conflict. Django will pick a column name of 'basket_id' for a ForeignKey field named 'basket', which is the same column name the old PositiveIntegerField had.
- Loading branch information
1 parent
8af9400
commit 1bbe821
Showing
7 changed files
with
1,965 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
486 changes: 486 additions & 0 deletions
486
oscar/apps/order/migrations/0019_auto__add_field_order_basket_alt.py
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
485 changes: 485 additions & 0 deletions
485
oscar/apps/order/migrations/0021_auto__del_field_order_basket_id.py
Large diffs are not rendered by default.
Oops, something went wrong.
479 changes: 479 additions & 0 deletions
479
oscar/apps/order/migrations/0022_rename_basket_field.py
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters