[phpBB Debug] PHP Warning: in file [ROOT]/includes/crs/crs_misc_functions.php on line 37: mime_content_type(): Empty filename or path
[phpBB Debug] PHP Warning: in file [ROOT]/includes/crs/crs_misc_functions.php on line 37: mime_content_type(): Empty filename or path
Zen Cart 源代码 mysql_upgrade_zencart_137_to_138.sql

Zen Cart 源代码 mysql_upgrade_zencart_137_to_138.sql




下载文件

文件名: mysql_upgrade_zencart_137_to_138.sql
文件类型: Unknown文件
文件大小: 14.53 KiB
MD5: 57838f1a5fb86ebd327ad87b8367b8bd

mysql_upgrade_zencart_137_to_138.sql - 关闭高亮
  1. #
  2. # * This SQL script upgrades the core Zen Cart database structure from v1.3.7 to v1.3.8
  3. # *
  4. # * @package Installer
  5. # * @access private
  6. # * @copyright Copyright 2003-2007 Zen Cart Development Team
  7. # * @copyright Portions Copyright 2003 osCommerce
  8. # * @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
  9. # * @version $Id: mysql_upgrade_zencart_137_to_138.sql 15140 2009-12-31 04:17:24Z drbyte $
  10. #
  11.  
  12. ############ IMPORTANT INSTRUCTIONS ###############
  13. #
  14. # * Zen Cart uses the zc_install/index.php program to do database upgrades
  15. # * This SQL script is intended to be used by running zc_install
  16. # * It is *not* recommended to simply run these statements manually via any other means
  17. # * ie: not via phpMyAdmin or via the Install SQL Patch tool in Zen Cart admin
  18. # * The zc_install program catches possible problems and also handles table-prefixes automatically
  19. # *
  20. # * To use the zc_install program to do your database upgrade:
  21. # * a. Upload the NEWEST zc_install folder to your server
  22. # * b. Surf to zc_install/index.php via your browser
  23. # * c. On the System Inspection page, scroll to the bottom and click on Database Upgrade
  24. # *    NOTE: do NOT click on the "Install" button, because that will erase your database.
  25. # * d. On the Database Upgrade screen, you'll be presented with a list of checkboxes for
  26. # *    various Zen Cart versions, with the recommended upgrades already pre-selected.
  27. # * e. Verify the checkboxes, then scroll down and enter your Zen Cart Admin username
  28. # *    and password, and then click on the Upgrade button.
  29. # * f. If any errors occur, you will be notified.  Some warnings can be ignored.
  30. # * g. When done, you'll be taken to the Finished page.
  31. #
  32. #####################################################
  33.  
  34. #Change Canada's code for Newfoundland from NF to NL, according to 2002 ISO standards change.
  35. UPDATE zones SET zone_code = 'NL' where zone_country_id = 38 and zone_name = 'Newfoundland';
  36.  
  37.  
  38. ## CONFIGURATION TABLE
  39. UPDATE configuration set configuration_description = 'Categories/Products Display Sort Order<br />0= Categories/Products Sort Order/Name<br />1= Categories/Products Name<br />2= Products Model<br />3= Products Qty+, Products Name<br />4= Products Qty-, Products Name<br />5= Products Price+, Products Name<br />6= Products Price-, Products Name' WHERE configuration_key = 'CATEGORIES_PRODUCTS_SORT_ORDER';
  40. UPDATE configuration set set_function = 'zen_cfg_select_option(array(\'0\', \'1\', \'2\', \'3\', \'4\', \'5\', \'6\', \'7\', \'8\', \'9\', \'10\', \'11\', \'12\'), ' where configuration_key = 'SHOW_PRODUCT_INFO_COLUMNS_ALSO_PURCHASED_PRODUCTS';
  41. UPDATE configuration set configuration_description = 'Number of new products listed per page' WHERE configuration_key='MAX_DISPLAY_PRODUCTS_NEW';
  42.  
  43. UPDATE configuration set configuration_description = 'If you have GoDaddy hosting or other hosting services that require use of a proxy to talk to external sites via cURL, enter their proxy address here.<br />format: address:port<br />ie: for GoDaddy, enter: <strong>proxy.shr.secureserver.net:3128</strong> or possibly 64.202.165.130:3128' WHERE configuration_key='CURL_PROXY_SERVER_DETAILS';
  44. UPDATE configuration set configuration_description = 'Does your mailserver require that all outgoing emails have their "from" address match a known domain that exists on your webserver?<br /><br />This is often required in order to prevent spoofing and spam broadcasts.  If set to Yes, this will cause the email address (sent FROM) to be used as the "from" address on all outgoing mail.' where configuration_key = 'EMAIL_SEND_MUST_BE_STORE';
  45. UPDATE configuration set use_function = 'zen_cfg_password_display' where configuration_key = 'EMAIL_SMTPAUTH_PASSWORD';
  46.  
  47. UPDATE configuration set configuration_value = 150, configuration_description = 'How many characters do you want to display of the Product Description?<br /><br />0= OFF<br />150= Suggested Length, or enter the maximum number of characters to display', set_function = '' WHERE configuration_key = 'PRODUCT_NEW_LIST_DESCRIPTION';
  48. UPDATE configuration set configuration_value = 150, configuration_description = 'How many characters do you want to display of the Product Description?<br /><br />0= OFF<br />150= Suggested Length, or enter the maximum number of characters to display', set_function = '' WHERE configuration_key = 'PRODUCT_FEATURED_LIST_DESCRIPTION';
  49. UPDATE configuration set configuration_value = 150, configuration_description = 'How many characters do you want to display of the Product Description?<br /><br />0= OFF<br />150= Suggested Length, or enter the maximum number of characters to display', set_function = '' WHERE configuration_key = 'PRODUCT_ALL_LIST_DESCRIPTION';
  50.  
  51. #UPDATE TO NEW RANDOMIZATION ON SIDEBOXES TO ALLOW MORE THAN ONE
  52. UPDATE configuration set configuration_value = '1', configuration_title = 'Random Product Reviews for SideBox', configuration_description = 'This is the number of random product REVIEWS to rotate in the sidebox<br /><br />Enter the number of products to display in this sidebox at one time.<br /><br />How many products do you want to display in this sidebox?' WHERE configuration_key='MAX_RANDOM_SELECT_REVIEWS';
  53. UPDATE configuration set configuration_value = '1', configuration_title = 'Random New Products for SideBox', configuration_description = 'This is the number of random NEW products to rotate in the sidebox<br /><br />Enter the number of products to display in this sidebox at one time.<br /><br />How many products do you want to display in this sidebox?' WHERE configuration_key='MAX_RANDOM_SELECT_NEW';
  54. UPDATE configuration set configuration_value = '1', configuration_title = 'Random Products On Special for SideBox', configuration_description = 'This is the number of random products on SPECIAL to rotate in the sidebox<br /><br />Enter the number of products to display in this sidebox at one time.<br /><br />How many products do you want to display in this sidebox?' WHERE configuration_key='MAX_RANDOM_SELECT_SPECIALS';
  55. UPDATE configuration set configuration_value = '1', configuration_title = 'Random Featured Products for SideBox', configuration_description = 'This is the number of random FEATURED products to rotate in the sidebox<br /><br />Enter the number of products to display in this sidebox at one time.<br /><br />How many products do you want to display in this sidebox?' WHERE configuration_key='MAX_RANDOM_SELECT_FEATURED_PRODUCTS';
  56.  
  57. INSERT INTO configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) VALUES ('Show Notice of Combining Shopping Cart on Login', 'SHOW_SHOPPING_CART_COMBINED', '1', 'When a customer logs in and has a previously stored shopping cart, the products are combined with the existing shopping cart.<br /><br />Do you wish to display a Notice to the customer?<br /><br />0= OFF, do not display a notice<br />1= Yes show notice and go to shopping cart<br />2= Yes show notice, but do not go to shopping cart', '9', '35', 'zen_cfg_select_option(array(\'0\', \'1\', \'2\'), ', now());
  58. INSERT INTO configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added, use_function, set_function) VALUES ('Display Order Comments on Admin Invoice', 'ORDER_COMMENTS_INVOICE', '1', 'Do you want to display the Order Comments on the Admin Invoice?<br />0= OFF<br />1= First Comment by Customer only<br />2= All Comments for the Order', 7, 25, now(), NULL, 'zen_cfg_select_option(array(''0'', ''1'', ''2''), ');
  59. INSERT INTO configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added, use_function, set_function) VALUES ('Display Order Comments on Admin Packing Slip', 'ORDER_COMMENTS_PACKING_SLIP', '1', 'Do you want to display the Order Comments on the Admin Packing Slip?<br />0= OFF<br />1= First Comment by Customer only<br />2= All Comments for the Order', 7, 26, now(), NULL, 'zen_cfg_select_option(array(''0'', ''1'', ''2''), ');
  60.  
  61. #audience list addition: customers who have signed up but never made a purchase
  62. INSERT INTO query_builder (query_category, query_name, query_description , query_string) VALUES ('email,newsletters', 'Customers who have never completed a purchase', 'For sending newsletter to all customers who registered but have never completed a purchase', 'SELECT DISTINCT c.customers_email_address as customers_email_address, c.customers_lastname as customers_lastname, c.customers_firstname as customers_firstname FROM TABLE_CUSTOMERS c LEFT JOIN  TABLE_ORDERS o ON c.customers_id=o.customers_id WHERE o.date_purchased IS NULL');
  63.  
  64. #admin
  65. ALTER TABLE admin_activity_log CHANGE page_parameters page_parameters text;
  66.  
  67.  
  68. #Allow for viewing
  69. ALTER TABLE orders_products_attributes CHANGE products_options_values products_options_values text NOT NULL;
  70.  
  71. ## PP EC table structure fixes ... needed longer fields in several cases for storing archive data and keep structures in sync
  72. ALTER TABLE paypal CHANGE txn_type txn_type varchar(40) NOT NULL default '';
  73. ALTER TABLE paypal CHANGE reason_code reason_code varchar(40) default NULL;
  74. ALTER TABLE paypal CHANGE payment_type payment_type varchar(40) NOT NULL default '';
  75. ALTER TABLE paypal CHANGE payment_status payment_status varchar(32) NOT NULL default '';
  76. ALTER TABLE paypal CHANGE pending_reason pending_reason varchar(32) default NULL;
  77. ALTER TABLE paypal CHANGE invoice invoice varchar(128) default NULL;
  78. ALTER TABLE paypal CHANGE payer_business_name payer_business_name varchar(128) default NULL;
  79. ALTER TABLE paypal CHANGE address_name address_name varchar(64) default NULL;
  80. ALTER TABLE paypal CHANGE address_street address_street varchar(254) default NULL;
  81. ALTER TABLE paypal CHANGE address_city address_city varchar(120) default NULL;
  82. ALTER TABLE paypal CHANGE address_state address_state varchar(120) default NULL;
  83. ALTER TABLE paypal CHANGE payer_email payer_email varchar(128) NOT NULL default '';
  84. ALTER TABLE paypal CHANGE business business varchar(128) NOT NULL default '';
  85. ALTER TABLE paypal CHANGE receiver_email receiver_email varchar(128) NOT NULL default '';
  86. ALTER TABLE paypal CHANGE txn_id txn_id varchar(20) NOT NULL default '';
  87. ALTER TABLE paypal CHANGE parent_txn_id parent_txn_id varchar(20) default NULL;
  88. ALTER TABLE paypal ADD COLUMN module_name varchar(40) NOT NULL default '' after txn_type;
  89. ALTER TABLE paypal ADD COLUMN module_mode varchar(40) NOT NULL default '' after module_name;
  90.  
  91. ALTER TABLE paypal_testing CHANGE txn_type txn_type varchar(40) NOT NULL default '';
  92. ALTER TABLE paypal_testing CHANGE reason_code reason_code varchar(40) default NULL;
  93. ALTER TABLE paypal_testing CHANGE payment_type payment_type varchar(40) NOT NULL default '';
  94. ALTER TABLE paypal_testing CHANGE payment_status payment_status varchar(32) NOT NULL default '';
  95. ALTER TABLE paypal_testing CHANGE pending_reason pending_reason varchar(32) default NULL;
  96. ALTER TABLE paypal_testing CHANGE invoice invoice varchar(128) default NULL;
  97. ALTER TABLE paypal_testing CHANGE payer_business_name payer_business_name varchar(128) default NULL;
  98. ALTER TABLE paypal_testing CHANGE address_name address_name varchar(64) default NULL;
  99. ALTER TABLE paypal_testing CHANGE address_street address_street varchar(254) default NULL;
  100. ALTER TABLE paypal_testing CHANGE address_city address_city varchar(120) default NULL;
  101. ALTER TABLE paypal_testing CHANGE address_state address_state varchar(120) default NULL;
  102. ALTER TABLE paypal_testing CHANGE payer_email payer_email varchar(128) NOT NULL default '';
  103. ALTER TABLE paypal_testing CHANGE business business varchar(128) NOT NULL default '';
  104. ALTER TABLE paypal_testing CHANGE receiver_email receiver_email varchar(128) NOT NULL default '';
  105. ALTER TABLE paypal_testing CHANGE txn_id txn_id varchar(20) NOT NULL default '';
  106. ALTER TABLE paypal_testing CHANGE parent_txn_id parent_txn_id varchar(20) default NULL;
  107. ALTER TABLE paypal_testing ADD COLUMN module_name varchar(40) NOT NULL default '' after txn_type;
  108. ALTER TABLE paypal_testing ADD COLUMN module_mode varchar(40) NOT NULL default '' after module_name;
  109.  
  110. ALTER TABLE paypal_session CHANGE saved_session saved_session mediumblob NOT NULL;
  111.  
  112. # Change TEXT field to varchar(50) since TEXT was a waste of space
  113. ALTER TABLE authorizenet CHANGE authorization_type authorization_type varchar(50) NOT NULL default '';
  114.  
  115. # change cache tracking size
  116. TRUNCATE TABLE db_cache;
  117. ALTER TABLE db_cache CHANGE cache_data cache_data mediumblob;
  118. TRUNCATE TABLE sessions;
  119. ALTER TABLE sessions CHANGE value value mediumblob NOT NULL;
  120.  
  121. #support longer ezpages content
  122. ALTER TABLE ezpages CHANGE pages_html_text pages_html_text mediumtext;
  123.  
  124. #############
  125.  
  126. #### VERSION UPDATE COMMANDS
  127. ## THE FOLLOWING 2 SECTIONS SHOULD BE THE "LAST" ITEMS IN THE FILE, so that if the upgrade fails prematurely, the version info is not updated.
  128. ##The following updates the version HISTORY to store the prior version's info (Essentially "moves" the prior version info from the "project_version" to "project_version_history" table
  129. #NEXT_X_ROWS_AS_ONE_COMMAND:3
  130. INSERT INTO project_version_history (project_version_key, project_version_major, project_version_minor, project_version_patch, project_version_date_applied, project_version_comment)
  131. SELECT project_version_key, project_version_major, project_version_minor, project_version_patch1 as project_version_patch, project_version_date_applied, project_version_comment
  132. FROM project_version;
  133.  
  134. ## Now set to new version
  135. UPDATE project_version SET project_version_major='1', project_version_minor='3.8', project_version_patch1='', project_version_patch1_source='', project_version_patch2='', project_version_patch2_source='', project_version_comment='Version Update 1.3.7->1.3.8', project_version_date_applied=now() WHERE project_version_key = 'Zen-Cart Main';
  136. UPDATE project_version SET project_version_major='1', project_version_minor='3.8', project_version_patch1='', project_version_patch1_source='', project_version_patch2='', project_version_patch2_source='', project_version_comment='Version Update 1.3.7->1.3.8', project_version_date_applied=now() WHERE project_version_key = 'Zen-Cart Database';
  137.  
  138.  
  139.  
  140. ### LEFT FOR END IN CASE ERRORS ARE ENCOUNTERED:
  141. #rename zen_order_id field to order_id to minimize confusion for folks who decide to manually edit their databases
  142. ALTER TABLE paypal CHANGE COLUMN zen_order_id order_id int(11) NOT NULL default '0';
  143. ALTER TABLE paypal_testing CHANGE COLUMN zen_order_id order_id int(11) NOT NULL default '0';
  144. ALTER TABLE linkpoint_api CHANGE COLUMN zen_order_id order_id int(11) NOT NULL default '0';
  145.  
  146.  
  147.  
  148. #####  END OF UPGRADE SCRIPT
  149.  


cron