Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save proudcommerce/192e4e39223beb7b0b2bf090abd0c605 to your computer and use it in GitHub Desktop.
Save proudcommerce/192e4e39223beb7b0b2bf090abd0c605 to your computer and use it in GitHub Desktop.
Set oxvendor = oxmanufacturers and oxmanufacutrers = oxvendor
# 1. Export oxvendors table + data (eg. oxvendor.sql)
# 2. Export oxmanufacturers table + data (eg. oxmanufacturers.sql)
# 3. Clean up manufacturers
DELETE FROM oxmanufacturers;
# 4. Clean up vendors
DELETE FROM oxvendor;
# 5. Replace "oxvendor" with "oxmanufacturers" in oxvendor.sql
# 6. Import oxvendor.sql
# 7. Replace "oxmanufacturers" with "oxvendor" in oxmanufacturers.sql
# 8. Import oxmanufacturers.sql
# 9. Switch oxvendor/oxmanufacturer ids (field oxshortdesc_3 used, change it!)
UPDATE oxarticles SET oxshortdesc_3 = oxmanufacturerid;
UPDATE oxarticles SET oxmanufacturerid = oxvendorid;
UPDATE oxarticles SET oxvendorid = oxshortdesc_3;
UPDATE oxarticles SET oxshortdesc_3 = '';
# 10. Done!
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment