Hello to everybody:

I have been using the module for a long time and i have to confirm that it's a very good one.
But i have a problem now, when trying to make a BBDD backup with UBERCART Module: the backup stores the data but doesnt create the table' structure.
So, i get an error message.

I find the problem in tables `uc_order_products_pair_vw`, `uc_order_products_qty_vw` and `uc_order_products_user_vw`,

Any suggestion? At the moment i fix the problem by coding but it takes me too much time
Thank you in advance

PD: i have tested it in version 1.x and version 2.x

Comments

madsph’s picture

ronan’s picture

Status: Active » Closed (duplicate)
drupalworlds’s picture

I found that after enabling the backup and migrate module, the module folder was crashed.
So I returned the files back to a same named folder as I suppose it was caused by my mistake.
After then, however, there was some problem for the backup of the uc_view tables.

Exactly, as the view tables could not be backed up properly.
//--------------------------------------------------------------------------------
DROP TABLE IF EXISTS `uc_order_products_pair_vw`;
;
DROP TABLE IF EXISTS `uc_order_products_qty_vw`;
;
INSERT INTO `uc_order_products_qty_vw` VALUES ('39','23','1.0000','23','1','1'),('44','1','1.0000','1','1','1'),('45','6','3.5000','21','7','1'),('46','1','1.0000','1','1','1');
DROP TABLE IF EXISTS `uc_order_products_user_vw`;
;
INSERT INTO `uc_order_products_user_vw` VALUES ('39','1','16','1.0000','16','1','1'),('44','1','1','1.0000','1','1','1'),('45','1','6','3.5000','21','7','1'),('46','1','1','1.0000','1','1','1');
//-----------------------------------------------------------------------------------------------

When the folder was crashed NORMALLY, it was correctly backed up as follows:
//---------------------------------------------------------------------------------------------
DROP VIEW IF EXISTS `uc_order_products_pair_vw`;
SET sql_mode = 'ANSI';
CREATE VIEW "uc_order_products_pair_vw" AS select "op1"."nid" AS "nid","op2"."nid" AS "pair_nid",sum("op2"."qty") AS "pair_sum_qty",count("op2"."nid") AS "order_count" from ("uc_order_products" "op1" join "uc_order_products" "op2") where (("op1"."order_id" = "op2"."order_id") and ("op1"."nid" <> "op2"."nid")) group by "op1"."nid","op2"."nid" order by "op1"."nid",count("op2"."nid") desc,sum("op2"."qty") desc;
SET sql_mode = 'STRICT_TRANS_TABLES,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION';
DROP VIEW IF EXISTS `uc_order_products_qty_vw`;
SET sql_mode = 'ANSI';
CREATE VIEW "uc_order_products_qty_vw" AS select "op"."nid" AS "nid",count("op"."nid") AS "order_count",avg("op"."qty") AS "avg_qty",sum("op"."qty") AS "sum_qty",max("op"."qty") AS "max_qty",min("op"."qty") AS "min_qty" from "uc_order_products" "op" group by "op"."nid" order by "op"."nid";
SET sql_mode = 'STRICT_TRANS_TABLES,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION';
DROP VIEW IF EXISTS `uc_order_products_user_vw`;
SET sql_mode = 'ANSI';
CREATE VIEW "uc_order_products_user_vw" AS select "op"."nid" AS "nid","o"."uid" AS "uid",count("o"."order_id") AS "order_count",avg("op"."qty") AS "avg_qty",sum("op"."qty") AS "sum_qty",max("op"."qty") AS "max_qty",min("op"."qty") AS "min_qty" from ("uc_order_products" "op" join "uc_orders" "o") where ("op"."order_id" = "o"."order_id") group by "o"."uid","op"."nid" order by "o"."uid","op"."nid";
SET sql_mode = 'STRICT_TRANS_TABLES,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION';
//----------------------------------------------------------------------------------------------------

Therefore, you should leave them crashed !