[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_139_to_150.sql
# # * This SQL script upgrades the core Zen Cart database structure from v1.3.9 to v1.5.0 # * # * @package Installer # * @access private # * @copyright Copyright 2003-2012 Zen Cart Development Team # * @copyright Portions Copyright 2003 osCommerce # * @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0 # * @version GIT: $Id: Author: DrByte Tue Aug 28 14:21:34 2012 -0400 Modified in v1.5.1 $ #
############ IMPORTANT INSTRUCTIONS ############### # # * Zen Cart uses the zc_install/index.php program to do database upgrades # * This SQL script is intended to be used by running zc_install # * It is *not* recommended to simply run these statements manually via any other means # * ie: not via phpMyAdmin or via the Install SQL Patch tool in Zen Cart admin # * The zc_install program catches possible problems and also handles table-prefixes automatically # * # * To use the zc_install program to do your database upgrade: # * a. Upload the NEWEST zc_install folder to your server # * b. Surf to zc_install/index.php via your browser # * c. On the System Inspection page, scroll to the bottom and click on Database Upgrade # * NOTE: do NOT click on the "Install" button, because that will erase your database. # * d. On the Database Upgrade screen, you will be presented with a list of checkboxes for # * various Zen Cart versions, with the recommended upgrades already pre-selected. # * e. Verify the checkboxes, then scroll down and enter your Zen Cart Admin username # * and password, and then click on the Upgrade button. # * f. If any errors occur, you will be notified. Some warnings can be ignored. # * g. When done, you will be taken to the Finished page. # #####################################################
# Set store to Down-For-Maintenance mode. Must reset manually via admin after upgrade is done. UPDATE configuration set configuration_value = 'true' where configuration_key = 'DOWN_FOR_MAINTENANCE';
# Clear out active customer sessions TRUNCATE TABLE whos_online; TRUNCATE TABLE db_cache; TRUNCATE TABLE sessions;
INSERT INTO configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) VALUES ('Telephone - Customer Service', 'STORE_TELEPHONE_CUSTSERVICE', '', 'Enter a telephone number for customers to reach your Customer Service department. This number may be sent as part of payment transaction details.', 1, 7, now()); INSERT INTO configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) VALUES ('login mode https', 'SSLPWSTATUSCHECK', '', 'System setting. Do not edit.', 6, 99, now());
UPDATE configuration set configuration_value = '900', configuration_description = 'Enter the time in seconds.<br />Max allowed is 900 for PCI Compliance Reasons.<br /> Default=900<br />Example: 900= 15 min <br /><br />Note: Too few seconds can result in timeout issues when adding/editing products', set_function = 'zen_cfg_select_option(array(\'900\', \'600\', \'300\'), ' where configuration_key = 'SESSION_TIMEOUT_ADMIN'; UPDATE configuration set configuration_title='CURL Proxy Address', configuration_value = '', configuration_group_id = 6, configuration_description = 'If you have a hosting service that requires use of a proxy to talk to external sites via cURL, enter their proxy address here.<br />format: address:port<br />ie: 127.0.0.1:3128' where configuration_key = 'CURL_PROXY_SERVER_DETAILS'; UPDATE configuration set configuration_title='CURL Proxy Status', configuration_value = 'False', configuration_group_id = 6 where configuration_key = 'CURL_PROXY_REQUIRED'; UPDATE configuration set configuration_description = 'Option Names and Values Global Add, Copy and Delete Features Status<br />0= Hide Features<br />1= Show Features<br />(Default=1)' where configuration_key = 'OPTION_NAMES_VALUES_GLOBAL_STATUS'; UPDATE configuration set sort_order=7 where configuration_key = 'STORE_NAME_ADDRESS'; UPDATE configuration set configuration_title='Admin Search Results Per Page', configuration_description='Number of products to list on an Admin search result page' where configuration_key = 'MAX_DISPLAY_SEARCH_RESULTS';
ALTER TABLE sessions CHANGE COLUMN sesskey sesskey varchar(64) NOT NULL default ''; ALTER TABLE admin_activity_log CHANGE COLUMN log_id log_id bigint(15) NOT NULL auto_increment; ALTER TABLE admin_activity_log ADD COLUMN flagged tinyint NOT NULL default '0'; ALTER TABLE admin_activity_log ADD COLUMN attention varchar(255) NOT NULL default ''; ALTER TABLE admin_activity_log ADD COLUMN gzpost mediumblob ; ALTER TABLE admin_activity_log DROP INDEX page_accessed; ALTER TABLE admin_activity_log DROP INDEX access_date; ALTER TABLE admin_activity_log ADD INDEX idx_page_accessed_zen (page_accessed); ALTER TABLE admin_activity_log ADD INDEX idx_access_date_zen (access_date); ALTER TABLE admin_activity_log ADD INDEX idx_flagged_zen (flagged); ALTER TABLE admin_activity_log CHANGE COLUMN ip_address ip_address varchar(20) NOT NULL default '';
ALTER TABLE whos_online CHANGE COLUMN ip_address ip_address varchar(20) NOT NULL default '';
ALTER TABLE admin ADD COLUMN admin_profile int(11) NOT NULL default '0' AFTER admin_email; ALTER TABLE admin ADD INDEX idx_admin_profile_zen (admin_profile); ALTER TABLE admin ADD COLUMN prev_pass1 varchar(40) NOT NULL default ''; ALTER TABLE admin ADD COLUMN prev_pass2 varchar(40) NOT NULL default ''; ALTER TABLE admin ADD COLUMN prev_pass3 varchar(40) NOT NULL default ''; ALTER TABLE admin ADD COLUMN pwd_last_change_date datetime NOT NULL default '0000-00-00 00:00:00'; ALTER TABLE admin ADD COLUMN reset_token varchar(60) NOT NULL default ''; ALTER TABLE admin ADD COLUMN last_modified datetime NOT NULL default '0000-00-00 00:00:00'; ALTER TABLE admin ADD COLUMN last_login_date datetime NOT NULL default '0000-00-00 00:00:00'; ALTER TABLE admin ADD COLUMN last_login_ip varchar(15) NOT NULL default ''; ALTER TABLE admin ADD COLUMN failed_logins smallint(4) unsigned NOT NULL default '0'; ALTER TABLE admin ADD COLUMN lockout_expires int(11) NOT NULL default '0'; ALTER TABLE admin ADD COLUMN last_failed_attempt datetime NOT NULL default '0000-00-00 00:00:00'; ALTER TABLE admin ADD COLUMN last_failed_ip varchar(15) NOT NULL default ''; UPDATE admin set pwd_last_change_date = now(); ALTER TABLE admin DROP COLUMN admin_level;
# # Table structure for table 'admin_menu' #
DROP TABLE IF EXISTS admin_menus; CREATE TABLE admin_menus ( menu_key VARCHAR(32) NOT NULL DEFAULT '', language_key VARCHAR(255) NOT NULL DEFAULT '', sort_order INT(11) NOT NULL DEFAULT 0, UNIQUE KEY menu_key (menu_key) );
# Clean up old US Armed Forces zones update address_book set entry_zone_id = ( select zone_id FROM zones where zone_country_id = 223 and zone_code = 'AE') where entry_zone_id in ( select zone_id FROM zones where zone_country_id = 223 and zone_code in ('AF', 'AM')); update address_book set entry_zone_id = ( select zone_id FROM zones where zone_country_id = 223 and zone_code = 'AA') where entry_zone_id in ( select zone_id FROM zones where zone_country_id = 223 and zone_code = 'AC'); delete from zones where zone_country_id = 223 and zone_code in ('AF', 'AM', 'AC');
#############
#### VERSION UPDATE STATEMENTS ## 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. ##The following updates the version HISTORY to store the prior version info (Essentially "moves" the prior version info from the "project_version" to "project_version_history" table #NEXT_X_ROWS_AS_ONE_COMMAND:3 INSERT INTO project_version_history (project_version_key, project_version_major, project_version_minor, project_version_patch, project_version_date_applied, project_version_comment) SELECT project_version_key, project_version_major, project_version_minor, project_version_patch1 as project_version_patch, project_version_date_applied, project_version_comment FROM project_version;
## Now set to new version UPDATE project_version SET project_version_major='1', project_version_minor='5.0', project_version_patch1='', project_version_patch1_source='', project_version_patch2='', project_version_patch2_source='', project_version_comment='Version Update 1.3.9->1.5.0', project_version_date_applied=now() WHERE project_version_key = 'Zen-Cart Main'; UPDATE project_version SET project_version_major='1', project_version_minor='5.0', project_version_patch1='', project_version_patch1_source='', project_version_patch2='', project_version_patch2_source='', project_version_comment='Version Update 1.3.9->1.5.0', project_version_date_applied=now() WHERE project_version_key = 'Zen-Cart Database';
##### END OF UPGRADE SCRIPT
## Country ISO changes (intended to be at end of this script in case of errors which should not prevent teh rest of the script from executing properly.) INSERT IGNORE INTO countries (countries_id, countries_name, countries_iso_code_2, countries_iso_code_3, address_format_id) VALUES (241,'Palestinian Territory','PS','PSE','1'); INSERT IGNORE INTO countries (countries_id, countries_name, countries_iso_code_2, countries_iso_code_3, address_format_id) VALUES (242,'Montenegro','ME','MNE','1'); INSERT IGNORE INTO countries (countries_id, countries_name, countries_iso_code_2, countries_iso_code_3, address_format_id) VALUES (243,'Guernsey','GG','GGY','1'); INSERT IGNORE INTO countries (countries_id, countries_name, countries_iso_code_2, countries_iso_code_3, address_format_id) VALUES (244,'Isle of Man','IM','IMN','1'); INSERT IGNORE INTO countries (countries_id, countries_name, countries_iso_code_2, countries_iso_code_3, address_format_id) VALUES (245,'Jersey','JE','JEY','1');