Clone wiki

satchmo / BackwardsIncompatibleChangesAfter0.6

Backwards Incompatible Changes After 0.6

Table of Contents

  • November 17, 2007: [#CustomProductEnhancements Updated Custom Products]
  • November 27, 2007: [#CategoryOrdering Added Arbitrary Category Ordering]
  • December 9, 2007: [#ProductAttributeLanguages Added Language Codes to Product Attributes]
  • December 10, 2007: [#AddedShopShippingCountries Added Shipping Countries to Shop Config]
  • December 13, 2007: [#IncreasedPhoneNumberLength Increased Phone Number field length on Contacts]
  • December 16, 2007: [#DiscountTrackingChanges Added discount columns to two tables]
  • December 21, 2007: [#OrderPaymentModelChange New field to the OrderPayment model]
  • December 29, 2007: [#AddedGiftCertificateApp Added gift certificate app]
  • January 8, 2008: [#AddedSKUField Added SKU Field]
  • January 15, 2008: [#AddedUnitsFields Added units field to dimensions]
  • February 11, 2008: [#AddedDigitstoPrices Added digits to prices]
  • February 18, 2008: [#AddedDigitstoOrderFields Added digits to order fields]
  • March 16, 2008: [#AddedSubscriptionProduct Added a subscription product type]
  • March 16, 2008: [#AddedTotalSoldProduct Added a total sold field to product]
  • March 19, 2008: [#RemovedCCV Removed the CCV column from credit card detail]
  • April 30, 2008: [#RemovedUsernameFallback Removed Username fallback from EmailBackend]
  • May 19, 2008: [#FixDownloadableProductLinks Fix downloadable product links]
  • May 24, 2008: [#AddedAutoDiscounts Added Auto Discounts]

Custom Product Enhancements

In [893] and [894], changes were made to the models used for Custom Products.

Category Ordering

in [905] added a new 'ordering' column to product_category, allowing override of alphabetical ordering.

Postgresql:

alter table product_category add column ordering integer default '0';

Product Attribute Languages

in [921] added a new 'languagecode' column to product_productranslation.

alter table product_productattribute add column languagecode varchar(10);

Added Shop Shipping Countries

in [922] added a new many-to-many field "Shipping Countries" to Shop Config. This means that you do not have to completely deactivate countries to remove them from shipping options. Instead, you select the countries currently enabled for shipping in the shop config page.

Django's syncdb command does not automatically create this table for an existing database; you will have to create it manually. Postgres version:

CREATE TABLE "shop_config_shipping_countries" (
    "id" serial NOT NULL PRIMARY KEY,
    "config_id" integer NOT NULL REFERENCES "shop_config" ("site_id") DEFERRABLE INITIALLY DEFERRED,
    "country_id" integer NOT NULL REFERENCES "l10n_country" ("id") DEFERRABLE INITIALLY DEFERRED,
    UNIQUE ("config_id", "country_id")
);

Increased Phone Number Length

In [947] increased phone number length from 12 to 30 to support international numbers.

Postgres version of change (You are using Postgres, right? Really, do yourself a favor and dump MySQL and its endless UTF problems.)

alter table contact_phonenumber alter column "phone" type varchar(30);

Discount Tracking Changes

In [958], added new columns to track discounts for shipping and on order line items. Also added a new table, contact_ordertaxdetail. Use Syncdb for that.

postgres

alter table contact_order add column shipping_discount numeric(6,2) null;
alter table contact_orderitem add column discount numeric(6,2) null;

sqlite

alter table contact_order add column shipping_discount decimal null;
alter table contact_orderitem add column discount decimal null;

!OrderPayment Model Change

In [966] a new field called transaction_id was added to the !OrderPayment model in order to support Paypal IPN.

alter table contact_orderpayment add column transaction_id varchar(25) null;

Added Gift Certificate App

A new app for gift certificates was added in [970]. You will need to add "satchmo.giftcertificate" to your INSTALLED_APPS setting and then run the syncdb command for your project.

Added SKU field

Added a SKU field in [982]

Postgres:

begin;
alter table product_product add column sku varchar(255) null;
--- Optional but suggested
update product_product set sku = product_product.slug;
commit;

Added Units Fields

In [1004] added weights_units, length_units, height_units, width_units fields to the product dimensions.

Mysql

alter table product_product add column weight_units type varchar(3);
alter table product_product add column length_units type varchar(3);
alter table product_product add column height_units type varchar(3);
alter table product_product add column width_units type varchar(3);

Postgres

alter table product_product add column weight_units varchar(3);
alter table product_product add column length_units varchar(3);
alter table product_product add column height_units varchar(3);
alter table product_product add column width_units varchar(3);

Added Digits to Prices

in [1032] increased the significant digits on products and options, to support EU VAT-style pricing, where you often need to price something at xxx.1667 so that when 20% is added, it is a round number.

Postgres

alter table product_price alter column price type numeric(14,6);
alter table product_option alter column price_change type numeric(14,6);
alter table product_customtextfield alter column price_change type numeric(14,6);

Added Digits to Order Fields

in [1038] increased the significant digits on order models, to support fractional amounts which are required to get taxes working properly, avoiding the issue where you end up with 1 pesky cent too low or too high, due to rounding errors.

Postgres

alter table contact_order alter column sub_total type numeric(18,10);
alter table contact_order alter column total type numeric(18,10);
alter table contact_order alter column discount type numeric(18,10);
alter table contact_order alter column shipping_cost type numeric(18,10);
alter table contact_order alter column shipping_discount type numeric(18,10);
alter table contact_order alter column tax type numeric(18,10);
alter table contact_orderitem alter column unit_price type numeric(18,10);
alter table contact_orderitem add column unit_tax numeric(18,10);
alter table contact_orderitem alter column line_item_price type numeric(18,10);
alter table contact_orderitem add column tax numeric(18,10);
alter table contact_orderitem alter column discount type numeric(18,10);
alter table contact_orderitemdetail alter column price_change type numeric(18,10);
alter table contact_orderpayment alter column amount type numeric(18,10);
alter table contact_ordertaxdetail alter column tax type numeric(18,10);

Added Subscription Product

In [1067] added a new subscription product. Also required two new fields to the contact model. I haven't worked out all the SQL commands to add the fields. This is a place holder to let people know to double check their systems.

''(Bruce) This worked for me on Postgres''

begin;
alter table contact_orderitem add column completed boolean default 'false';
alter table contact_orderitem add column expire_date date null;
commit;

Added Total Sold Product

In [1070] added a total_sold field to the Product Model.

alter table product_product add column total_sold integer default '0';

Removed CCV

In [1074] removed CCV information from the database.

begin;
alter table payment_creditcarddetail drop column ccv;
commit;

Removed Username Fallback

In [1170] removed the username fallback from EmailBackend. To maintain existing functionality in stores, you must add a second line to your AUTHENTICATION BACKENDS in settings.py

AUTHENTICATION_BACKENDS = (
    'satchmo.accounts.email-auth.EmailBackend',
    'django.contrib.auth.backends.ModelBackend',
)

The database model for downloadable products was not correct. It is fixed in [1198]. Unless you're using this feature, all you need to do is drop the table and execute a syncdb to recreate it:

DROP TABLE contact_downloadlink;

Added Auto Discounts

In [1211] we added a new field to discount_discount to support store-wide-sales.

SQL:

alter table discount_discount add column "automatic" boolean default 'false';

Updated