📄 mysql_zencart.sql
字号:
DROP TABLE IF EXISTS products;
CREATE TABLE products (
products_id int(11) NOT NULL auto_increment,
products_type int(11) NOT NULL default '1',
products_quantity float NOT NULL default '0',
products_model varchar(32) default NULL,
products_upc varchar(32) NULL default NULL,
products_isbn varchar(32) NULL default NULL,
products_image varchar(64) default NULL,
products_price decimal(15,4) NOT NULL default '0.0000',
products_virtual tinyint(1) NOT NULL default '0',
products_date_added datetime NOT NULL default '0001-01-01 00:00:00',
products_last_modified datetime default NULL,
products_date_available datetime default NULL,
products_weight float NOT NULL default '0',
products_status tinyint(1) NOT NULL default '0',
products_tax_class_id int(11) NOT NULL default '0',
manufacturers_id int(11) default NULL,
products_ordered float NOT NULL default '0',
products_quantity_order_min float NOT NULL default '1',
products_quantity_order_units float NOT NULL default '1',
products_priced_by_attribute tinyint(1) NOT NULL default '0',
product_is_free tinyint(1) NOT NULL default '0',
product_is_call tinyint(1) NOT NULL default '0',
products_quantity_mixed tinyint(1) NOT NULL default '0',
product_is_always_free_shipping tinyint(1) NOT NULL default '0',
products_qty_box_status tinyint(1) NOT NULL default '1',
products_quantity_order_max float NOT NULL default '0',
products_sort_order int(11) NOT NULL default '0',
products_discount_type tinyint(1) NOT NULL default '0',
products_discount_type_from tinyint(1) NOT NULL default '0',
products_price_sorter decimal(15,4) NOT NULL default '0.0000',
master_categories_id int(11) NOT NULL default '0',
products_mixed_discount_quantity tinyint(1) NOT NULL default '1',
metatags_title_status tinyint(1) NOT NULL default '0',
metatags_products_name_status tinyint(1) NOT NULL default '0',
metatags_model_status tinyint(1) NOT NULL default '0',
metatags_price_status tinyint(1) NOT NULL default '0',
metatags_title_tagline_status tinyint(1) NOT NULL default '0',
PRIMARY KEY (products_id),
KEY idx_products_date_added_zen (products_date_added),
KEY idx_products_status_zen (products_status),
KEY idx_products_date_available_zen (products_date_available),
KEY idx_products_ordered_zen (products_ordered),
KEY idx_products_model_zen (products_model),
KEY idx_products_price_sorter_zen (products_price_sorter),
KEY idx_master_categories_id_zen (master_categories_id),
KEY idx_products_sort_order_zen (products_sort_order),
KEY idx_manufacturers_id_zen (manufacturers_id)
) CHARACTER SET utf8 COLLATE utf8_general_ci;
# --------------------------------------------------------
#
# Table structure for table 'products_attributes'
#
DROP TABLE IF EXISTS products_attributes;
CREATE TABLE products_attributes (
products_attributes_id int(11) NOT NULL auto_increment,
products_id int(11) NOT NULL default '0',
options_id int(11) NOT NULL default '0',
options_values_id int(11) NOT NULL default '0',
options_values_price decimal(15,4) NOT NULL default '0.0000',
price_prefix char(1) NOT NULL default '',
products_options_sort_order int(11) NOT NULL default '0',
product_attribute_is_free tinyint(1) NOT NULL default '0',
products_attributes_weight float NOT NULL default '0',
products_attributes_weight_prefix char(1) NOT NULL default '',
attributes_display_only tinyint(1) NOT NULL default '0',
attributes_default tinyint(1) NOT NULL default '0',
attributes_discounted tinyint(1) NOT NULL default '1',
attributes_image varchar(64) default NULL,
attributes_price_base_included tinyint(1) NOT NULL default '1',
attributes_price_onetime decimal(15,4) NOT NULL default '0.0000',
attributes_price_factor decimal(15,4) NOT NULL default '0.0000',
attributes_price_factor_offset decimal(15,4) NOT NULL default '0.0000',
attributes_price_factor_onetime decimal(15,4) NOT NULL default '0.0000',
attributes_price_factor_onetime_offset decimal(15,4) NOT NULL default '0.0000',
attributes_qty_prices text,
attributes_qty_prices_onetime text,
attributes_price_words decimal(15,4) NOT NULL default '0.0000',
attributes_price_words_free int(4) NOT NULL default '0',
attributes_price_letters decimal(15,4) NOT NULL default '0.0000',
attributes_price_letters_free int(4) NOT NULL default '0',
attributes_required tinyint(1) NOT NULL default '0',
PRIMARY KEY (products_attributes_id),
KEY idx_id_options_id_values_zen (products_id,options_id,options_values_id),
KEY idx_opt_sort_order_zen (products_options_sort_order)
) CHARACTER SET utf8 COLLATE utf8_general_ci;
# --------------------------------------------------------
#
# Table structure for table 'products_attributes_download'
#
DROP TABLE IF EXISTS products_attributes_download;
CREATE TABLE products_attributes_download (
products_attributes_id int(11) NOT NULL default '0',
products_attributes_filename varchar(255) NOT NULL default '',
products_attributes_maxdays int(2) default '0',
products_attributes_maxcount int(2) default '0',
PRIMARY KEY (products_attributes_id)
) CHARACTER SET utf8 COLLATE utf8_general_ci;
# --------------------------------------------------------
#
# Table structure for table 'products_description'
#
DROP TABLE IF EXISTS products_description;
CREATE TABLE products_description (
products_id int(11) NOT NULL auto_increment,
language_id int(11) NOT NULL default '1',
products_name varchar(64) NOT NULL default '',
products_description text,
products_url varchar(255) default NULL,
products_viewed int(5) default '0',
PRIMARY KEY (products_id,language_id),
KEY idx_products_name_zen (products_name)
) CHARACTER SET utf8 COLLATE utf8_general_ci;
# --------------------------------------------------------
#
# Table structure for table 'products_discount_quantity'
#
DROP TABLE IF EXISTS products_discount_quantity;
CREATE TABLE products_discount_quantity (
discount_id int(4) NOT NULL default '0',
products_id int(11) NOT NULL default '0',
discount_qty float NOT NULL default '0',
discount_price decimal(15,4) NOT NULL default '0.0000',
KEY idx_id_qty_zen (products_id,discount_qty)
) CHARACTER SET utf8 COLLATE utf8_general_ci;
# --------------------------------------------------------
#
# Table structure for table 'products_notifications'
#
DROP TABLE IF EXISTS products_notifications;
CREATE TABLE products_notifications (
products_id int(11) NOT NULL default '0',
customers_id int(11) NOT NULL default '0',
date_added datetime NOT NULL default '0001-01-01 00:00:00',
PRIMARY KEY (products_id,customers_id)
) CHARACTER SET utf8 COLLATE utf8_general_ci;
# --------------------------------------------------------
#
# Table structure for table 'products_options'
#
DROP TABLE IF EXISTS products_options;
CREATE TABLE products_options (
products_options_id int(11) NOT NULL default '0',
language_id int(11) NOT NULL default '1',
products_options_name varchar(32) NOT NULL default '',
products_options_sort_order int(11) NOT NULL default '0',
products_options_type int(5) NOT NULL default '0',
products_options_length smallint(2) NOT NULL default '32',
products_options_comment varchar(64) default NULL,
products_options_size smallint(2) NOT NULL default '32',
products_options_images_per_row int(2) default '5',
products_options_images_style int(1) default '0',
products_options_rows smallint(2) NOT NULL default '1',
PRIMARY KEY (products_options_id,language_id),
KEY idx_lang_id_zen (language_id),
KEY idx_products_options_sort_order_zen (products_options_sort_order),
KEY idx_products_options_name_zen (products_options_name)
) CHARACTER SET utf8 COLLATE utf8_general_ci;
# --------------------------------------------------------
#
# Table structure for table 'products_options_types'
#
DROP TABLE IF EXISTS products_options_types;
CREATE TABLE products_options_types (
products_options_types_id int(11) NOT NULL default '0',
products_options_types_name varchar(32) default NULL,
PRIMARY KEY (products_options_types_id)
) CHARACTER SET utf8 COLLATE utf8_general_ci COMMENT='Track products_options_types';
# --------------------------------------------------------
#
# Table structure for table 'products_options_values'
#
DROP TABLE IF EXISTS products_options_values;
CREATE TABLE products_options_values (
products_options_values_id int(11) NOT NULL default '0',
language_id int(11) NOT NULL default '1',
products_options_values_name varchar(64) NOT NULL default '',
products_options_values_sort_order int(11) NOT NULL default '0',
PRIMARY KEY (products_options_values_id,language_id),
KEY idx_products_options_values_name_zen (products_options_values_name),
KEY idx_products_options_values_sort_order_zen (products_options_values_sort_order)
) CHARACTER SET utf8 COLLATE utf8_general_ci;
# --------------------------------------------------------
#
# Table structure for table 'products_options_values_to_products_options'
#
DROP TABLE IF EXISTS products_options_values_to_products_options;
CREATE TABLE products_options_values_to_products_options (
products_options_values_to_products_options_id int(11) NOT NULL auto_increment,
products_options_id int(11) NOT NULL default '0',
products_options_values_id int(11) NOT NULL default '0',
PRIMARY KEY (products_options_values_to_products_options_id),
KEY idx_products_options_id_zen (products_options_id),
KEY idx_products_options_values_id_zen (products_options_values_id)
) CHARACTER SET utf8 COLLATE utf8_general_ci;
# --------------------------------------------------------
#
# Table structure for table 'products_to_categories'
#
DROP TABLE IF EXISTS products_to_categories;
CREATE TABLE products_to_categories (
products_id int(11) NOT NULL default '0',
categories_id int(11) NOT NULL default '0',
PRIMARY KEY (products_id,categories_id),
KEY idx_cat_prod_id_zen (categories_id,products_id)
) CHARACTER SET utf8 COLLATE utf8_general_ci;
# --------------------------------------------------------
#
# Table structure for table 'project_version'
#
DROP TABLE IF EXISTS project_version;
CREATE TABLE project_version (
project_version_id tinyint(3) NOT NULL auto_increment,
project_version_key varchar(40) NOT NULL default '',
project_version_major varchar(20) NOT NULL default '',
project_version_minor varchar(20) NOT NULL default '',
project_version_patch1 varchar(20) NOT NULL default '',
project_version_patch2 varchar(20) NOT NULL default '',
project_version_patch1_source varchar(20) NOT NULL default '',
project_version_patch2_source varchar(20) NOT NULL default '',
project_version_comment varchar(250) NOT NULL default '',
project_version_date_applied datetime NOT NULL default '0001-01-01 01:01:01',
PRIMARY KEY (project_version_id),
UNIQUE KEY idx_project_version_key_zen (project_version_key)
) CHARACTER SET utf8 COLLATE utf8_general_ci COMMENT='Database Version Tracking';
# --------------------------------------------------------
#
# Table structure for table 'project_version_history'
#
DROP TABLE IF EXISTS project_version_history;
CREATE TABLE project_version_history (
project_version_id tinyint(3) NOT NULL auto_increment,
project_version_key varchar(40) NOT NULL default '',
project_version_major varchar(20) NOT NULL default '',
project_version_minor varchar(20) NOT NULL default '',
project_version_patch varchar(20) NOT NULL default '',
project_version_comment varchar(250) NOT NULL default '',
project_version_date_applied datetime NOT NULL default '0001-01-01 01:01:01',
PRIMARY KEY (project_version_id)
) CHARACTER SET utf8 COLLATE utf8_general_ci COMMENT='Database Version Tracking History';
# --------------------------------------------------------
#
# Table structure for table 'query_builder'
# This table is used by audiences.php for building data-extraction queries
#
DROP TABLE IF EXISTS query_builder;
CREATE TABLE query_builder (
query_id int(11) NOT NULL auto_increment,
query_category varchar(40) NOT NULL default '',
query_name varchar(80) NOT NULL default '',
query_description TEXT NOT NULL,
query_string TEXT NOT NULL,
query_keys_list TEXT NOT NULL,
PRIMARY KEY (query_id),
UNIQUE KEY query_name (query_name)
) CHARACTER SET utf8 COLLATE utf8_general_ci COMMENT='Stores queries for re-use in Admin email and report modules';
# --------------------------------------------------------
#
# Table structure for table 'record_artists'
#
DROP TABLE IF EXISTS record_artists;
CREATE TABLE record_artists (
artists_id int(11) NOT NULL auto_increment,
artists_name varchar(32) NOT NULL default '',
artists_image varchar(64) default NULL,
date_added datetime default NULL,
last_modified datetime default NULL,
PRIMARY KEY (artists_id),
KEY idx_rec_artists_name_zen (artists_name)
) CHARACTER SET utf8 COLLATE utf8_general_ci;
# --------------------------------------------------------
#
# Table structure for table 'record_artists_info'
#
DROP TABLE IF EXISTS record_artists_info;
CREATE TABLE record_artists_info (
artists_id int(11) NOT NULL default '0',
languages_id int(11) NOT NULL default '0',
artists_url varchar(255) NOT NULL default '',
url_clicked int(5) NOT NULL default '0',
date_last_click datetime default NULL,
PRIMARY KEY (artists_id,languages_id)
) CHARACTER SET utf8 COLLATE utf8_general_ci;
# --------------------------------------------------------
#
# Table structure for table 'record_company'
#
DROP TABLE IF EXISTS record_company;
CREATE TABLE record_company (
record_company_id int(11) NOT NULL auto_increment,
record_company_name varchar(32) NOT NULL default '',
record_company_image varchar(64) default NULL,
date_added datetime default NULL,
last_modified datetime default NULL,
PRIMARY KEY (record_company_id),
KEY idx_rec_company_name_zen (record_company_name)
) CHARACTER SET utf8 COLLATE utf8_general_ci;
# --------------------------------------------------------
#
# Table structure for table 'record_company_info'
#
DROP TABLE IF EXISTS record_company_info;
CREATE TABLE record_company_info (
record_company_id int(11) NOT NULL default '0',
languages_id int(11) NOT NULL default '0',
record_company_url varchar(255) NOT NULL default '
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -