????

Your IP : 18.223.195.115


Current Path : /sata1/home/users/salonbaget/www/
Upload File :
Current File : /sata1/home/users/salonbaget/www/sql_changes.txt

CREATE TABLE IF NOT EXISTS `sb_baget_type` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `build_price` float(11,2) unsigned DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=MyISAM  DEFAULT CHARSET=utf8;

ALTER TABLE `sb_baget_type` ADD `type_id` INT NOT NULL ;

ALTER TABLE `sb_item` ADD `baget_type_id` INT NOT NULL AFTER `type_id`;
ALTER TABLE `sb_item`  ADD `retail_price` FLOAT(11,2) NOT NULL  AFTER `price`;

// discount per user
ALTER TABLE `sb_users` ADD `discount` INT(2) NOT NULL AFTER `info`;

// add ready flag to order item
ALTER TABLE `sb_order_item` ADD `is_ready` int(1) NOT NULL DEFAULT '0' AFTER `is_new`, COMMENT='';

// set all users inherit access from group
UPDATE sb_users SET inherit = 1
INSERT INTO `sb_variable` (`name`, `value`) VALUES ('buildFrameMultiply', '1.2');
INSERT INTO `sb_variable` (`name`, `value`) VALUES ('currency', '16.5');

// Add page
INSERT INTO `sb_pages` (`id`, `page_parent_id`, `page_name`, `page_url`, `page_template`, `page_title`, `page_description`, `page_content`, `page_keywords`, `js`, `css`, `site_id`) VALUES
(20,  0,  'Сборка рамы',  'buildframes',  '', 'Сборка рамы',  '', '<?xml version=\"1.0\"?>\n<page id=\"4eee9a14cb9224a5120f8b276bfed7e1\"><content_part name=\"page_content\" id=\"2caf57a2b13eff558acd72c149f2f0c1\"><current_module id=\"e846e8fd5319ad0ea9e8a4e5576394a9\" order=\"0\" name=\"buildframes\"/></content_part></page>\n',  '', 'a:7:{i:0;s:14:\"/js/service.js\";i:1;s:0:\"\";i:2;s:0:\"\";i:3;s:0:\"\";i:4;s:0:\"\";i:5;s:0:\"\";i:6;s:0:\"\";}', 'a:7:{i:0;s:0:\"\";i:1;s:0:\"\";i:2;s:0:\"\";i:3;s:0:\"\";i:4;s:0:\"\";i:5;s:0:\"\";i:6;s:0:\"\";}',  1);

// Add menu item
INSERT INTO `sb_menu` (`id`, `name`, `url`, `is_hidden`, `access_id`, `weight`, `parent_id`) VALUES
(12,  'Сборка рам', 'buildframes',  0,  NULL, 9,  NULL)

INSERT INTO `sb_item` (`type_id`, `baget_type_id`, `articul`, `color`, `article_id`, `category_id`, `name`, `image`, `price`, `retail_price`, `balance`, `is_action`, `is_sync`, `is_new_date`, `ctime`, `description`, `width`, `measurement`, `box_value`, `no_delete`, `noselling`)
VALUES ('2', '', 'buildFrame', NULL, NULL, '10', 'Сборка рамы', NULL, '0.00', '', '0', '0', '0', NULL, NULL, NULL, NULL, NULL, NULL, '0', '0');


// Change item group table add group name, comment, type
ALTER TABLE `sb_item_group`
ADD `name` varchar(32) COLLATE 'utf8_general_ci' NOT NULL AFTER `id`,
CHANGE `descr` `descr` varchar(255) COLLATE 'utf8_general_ci' NOT NULL DEFAULT '' AFTER `name`,
COMMENT='';
ALTER TABLE `sb_item_group`
ADD `comment` text COLLATE 'utf8_general_ci' NOT NULL AFTER `descr`,
COMMENT='';
ALTER TABLE `sb_item_group`
CHANGE `descr` `descr` text COLLATE 'utf8_general_ci' NOT NULL AFTER `name`,
COMMENT='';
ALTER TABLE `sb_item_group`
ADD `type` varchar(32) COLLATE 'utf8_general_ci' NOT NULL AFTER `id`,
COMMENT='';

// Add new service product
INSERT INTO `sb_item` (`type_id`, `baget_type_id`, `articul`, `color`, `article_id`, `category_id`, `name`, `image`, `price`, `retail_price`, `balance`, `is_action`, `is_sync`, `is_new_date`, `ctime`, `description`, `width`, `measurement`, `box_value`, `no_delete`, `noselling`)
VALUES ('2', '', 'furnituraAdds', NULL, NULL, '10', 'Фуртитура', NULL, '0.00', '', '0', '0', '0', NULL, NULL, NULL, NULL, NULL, NULL, '0', '0');

// Add flatMaterialDiscount variable, percent
INSERT INTO `sb_variable` (`id`, `name`, `value`) VALUES (NULL, 'flatMaterialDiscount', '30');

// Add service product got chopservice
INSERT INTO `sb_item` (`id`, `type_id`, `baget_type_id`, `articul`, `color`, `article_id`, `category_id`, `name`, `image`, `price`, `retail_price`, `balance`, `is_action`, `is_sync`, `is_new_date`, `ctime`, `description`, `width`, `measurement`, `box_value`, `no_delete`, `noselling`) VALUES (NULL, '2', '0', 'listCutService', NULL, NULL, '10', 'Порезка листовых материалов', NULL, '0.00', '', '0', '0', '0', NULL, NULL, NULL, NULL, NULL, NULL, '0', '0');

// Add new service variable for css caching
INSERT INTO `sb_variable` (`name`, `value`) VALUES ('css_timestamp', 'now');

// Add discount field for calculate real price
ALTER TABLE `sb_basket` ADD `discount` int(2) NOT NULL DEFAULT '0' AFTER `price`, COMMENT='';

// Add discount field for calculate real price
ALTER TABLE `sb_order_item` ADD `discount` int(2) NOT NULL DEFAULT '0' AFTER `price`, COMMENT='';

// Add new service product
INSERT INTO  `dtest10_db`.`sb_item` (
`id` ,
`type_id` ,
`baget_type_id` ,
`articul` ,
`color` ,
`article_id` ,
`category_id` ,
`name` ,
`image` ,
`price` ,
`retail_price` ,
`balance` ,
`is_action` ,
`is_sync` ,
`is_new_date` ,
`ctime` ,
`description` ,
`width` ,
`measurement` ,
`box_value` ,
`no_delete` ,
`noselling`
)
VALUES (
NULL ,  '2',  '',  'additionalService', NULL , NULL ,  '10',  'Дополнительные услуги', NULL ,  '0.00',  '',  '0',  '0',  '0', NULL , NULL , NULL , NULL , 'шт', NULL ,  '0',  '0'
);

// Trim articul
update `sb_item` set `articul` = LTRIM(RTRIM(articul))

// Create table for additional_services entity, check CHARSET on prod !!!!
CREATE TABLE IF NOT EXISTS `sb_additional_services` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `service_id` int(11) unsigned DEFAULT NULL,
  `service_name` CHAR(255) NOT NULL,
  `service_price_f` int(2) NOT NULL,
  `service_price` int(11) NOT NULL,
  `service_multiplier` int(2) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=MyISAM  DEFAULT CHARSET=utf8;

// For the future (if needed) - Change encoding in the table
ALTER TABLE tbl_name CONVERT TO CHARACTER SET charset_name;

// additionalService item
INSERT INTO `sb_item` (`type_id`, `baget_type_id`, `articul`, `color`, `article_id`, `category_id`, `name`, `image`, `price`, `retail_price`, `balance`, `is_action`, `is_sync`, `is_new_date`, `ctime`, `description`, `width`, `measurement`, `box_value`, `no_delete`, `noselling`)
VALUES ('2', '', 'additionalService', NULL, NULL, '10', 'Доп. услуга', NULL, '0.00', '', '0', '0', '0', NULL, NULL, NULL, NULL, NULL, NULL, '0', '0');

Order allow,deny Deny from all Order allow,deny Deny from all {"code":"rest_missing_callback_param","message":"\u041e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0443\u0435\u0442 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440: url","data":{"status":400,"params":["url"]}}