Adds a data migration to fix the bad product versions data. We need to fix this because we have some orders associated with them and their checkout/receipts are breaking.
Screenshots (if appropriate):
Validation
How can this be tested?
Add some Courses, course runs with courseware_id containing some spaces (On master branch)
Add relevant data e.g. product product versions. Make sure you have added enough data required for a successful checkout with price
Now, Place an order for this product
Create another course as mentioned above, But this time just add it to the cart and don't checkout
Get back to the course runs & update the courseware_id for both the courses and remove the spaces, Note that the receipt would start breaking likewise, the checkout would also start breaking
Also, Try adding spaces in the courseware_id field through Django Admin
NOTE: This also temporarily disables the update lock on the database for the product version table, but puts it back once we update the data. So, Ensure that the protection rules are applied back properly after the migration. You can try updating a product version entry and you should not be able to do that by any means either by Django Admin, Django Shell, or database SQL script.
What are the relevant tickets?
https://github.com/mitodl/hq/issues/4568
Description (What does it do?)
Screenshots (if appropriate):
Validation
How can this be tested?
NOTE: This also temporarily disables the update lock on the database for the product version table, but puts it back once we update the data. So, Ensure that the protection rules are applied back properly after the migration. You can try updating a product version entry and you should not be able to do that by any means either by Django Admin, Django Shell, or database SQL script.