I'm using the SVN version to keep up with fixes, and now need to do an upgrade.
I'd like to learn from others to see how they do it.
- The code base can be updated with "svn update" and local mods detected and blended in this way too (svn update -u, svn status and svn diff).
- DB changes seem more tricky
- The install GUI update option cannot be used because it is grayed out (because the official version in settings.inc has not changed)
My first attempt (for upgrade from SVN revision 370 of early Jan to 463):
cd install-dev/sql
svn diff -r 370:463|more
This gives a long list though, for example:
Quote
===================================================================
--- db_settings_lite.sql (revision 370)
+++ db_settings_lite.sql (revision 463)
@@ -42,7 +42,8 @@
(39, 'cancelProduct', 'Product cancelled', 'This hook is called when you cancel a product in an order', 0),
(40, 'extraLeft', 'Extra actions on the product page (left column).', NULL, 0),
(41, 'productOutOfStock', 'Product out of stock', 'Make action while product is out of stock', 1),
-(42, 'updateProductAttribute', 'Product attribute update', NULL, 0);
+(42, 'updateProductAttribute', 'Product attribute update', NULL, 0),
+(43, 'extraCarrier', 'Extra carrier (module mode)', NULL, 0);
INSERT INTO `PREFIX_configuration` (`id_configuration`, `name`, `value`, `date_add`, `date_upd`) VALUES
(1, 'PS_LANG_DEFAULT', '1', NOW(), NOW()),
@@ -101,11 +102,9 @@
INSERT INTO `PREFIX_category` VALUES
(1, 0, 0, 1, NOW(), NOW());
-INSERT INTO `PREFIX_category_lang` VALUES
-(1, 1, 'Home', '', '', NULL, NULL, NULL),
-(1, 2, 'Accueil', '', '', NULL, NULL, NULL),
-(1, 3, 'Startseite', '', '', NULL, NULL, NULL),
-(1, 4, 'Inicio', '', '', NULL, NULL, NULL);
+INSERT INTO `PREFIX_category_lang` (`id_category`, `id_lang`, `name`, `description`, `link_rewrite`, `meta_title`, `meta_keywords`, `meta_description`) V
ALUES
+(1, 1, 'Home', '', 'home', NULL, NULL, NULL),
+(1, 2, 'Accueil', '', 'home', NULL, NULL, NULL);
....
Then I restricted it to install-dev/sql/upgrade, but even then there is about 3 pages of changes starting like:
Quote
===================================================================
--- 1.2.0.1.sql (revision 370)
+++ 1.2.0.1.sql (revision 463)
@@ -15,12 +15,18 @@
ALTER TABLE PREFIX_customer
ADD deleted TINYINT(1) NOT NULL DEFAULT 0 AFTER active,
DROP INDEX `customer_email`;
-
+
ALTER TABLE PREFIX_employee
- ADD stats_date_to DATE NULL AFTER last_passwd_gen;
+ ADD stats_date_to DATE NULL DEFAULT NULL AFTER last_passwd_gen;
ALTER TABLE PREFIX_employee
- ADD stats_date_from DATE NULL AFTER last_passwd_gen;
+ ADD stats_date_from DATE NULL DEFAULT NULL AFTER last_passwd_gen;
+ALTER TABLE PREFIX_order_state ADD hidden TINYINT(1) UNSIGNED NOT NULL DEFAULT 0 AFTER unremovable;
+
+ALTER TABLE PREFIX_carrier ADD is_module TINYINT(1) UNSIGNED NOT NULL DEFAULT 0 AFTER range_behavior;
+
+ALTER TABLE PREFIX_order_detail CHANGE product_quantity_cancelled product_quantity_refunded INT(10) UNSIGNED NOT NULL DEFAULT 0;
+
CREATE TABLE PREFIX_customer_group (
id_customer INTEGER UNSIGNED NOT NULL,
id_group INTEGER UNSIGNED NOT NULL,
@@ -89,8 +95,8 @@
cache_registrations INTEGER NULL,
cache_orders INTEGER NULL,
cache_sales DECIMAL(10,2) NULL,
- cache_reg_rate DECIMAL(8,4) NULL,
- cache_order_rate DECIMAL(8,4) NULL,
+ cache_reg_rate DECIMAL(5,2) NULL,
+ cache_order_rate DECIMAL(5,2) NULL,
date_add DATETIME NOT NULL,
PRIMARY KEY (`id_referrer`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
@@ -108,10 +114,19 @@
PRIMARY KEY (`id_module`, `id_group`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
....
This is not so easy to interpret and use.
Switching then to Windows with Tortoise SVN's diff window, its a bit easier to read, giving changes like this:
Quote
DROP INDEX `customer_email`;
ALTER TABLE PREFIX_employee
ADD stats_date_to DATE NULL DEFAULT NULL AFTER last_passwd_gen;
ALTER TABLE PREFIX_employee
ADD stats_date_from DATE NULL DEFAULT NULL AFTER last_passwd_gen;
ALTER TABLE PREFIX_order_state ADD hidden TINYINT(1) UNSIGNED NOT NULL DEFAULT 0 AFTER unremovable;
ALTER TABLE PREFIX_carrier ADD is_module TINYINT(1) UNSIGNED NOT NULL DEFAULT 0 AFTER range_behavior;
ALTER TABLE PREFIX_order_detail CHANGE product_quantity_cancelled product_quantity_refunded INT(10) UNSIGNED NOT NULL DEFAULT 0;
...
So apart from substituting TABLE PREFIX, these would be the changes needed.
Sorry if this posting is a bit long winded but the idea was to give as much details as possible.
How are others managing such upgrades?
Thanks in advance,
Sean




Back to top









