ecshop数据库详细分析.docx
《ecshop数据库详细分析.docx》由会员分享,可在线阅读,更多相关《ecshop数据库详细分析.docx(68页珍藏版)》请在冰豆网上搜索。
![ecshop数据库详细分析.docx](https://file1.bdocx.com/fileroot1/2023-8/13/feb39dd6-1600-4372-b60c-e1a88a56ab2f/feb39dd6-1600-4372-b60c-e1a88a56ab2f1.gif)
ecshop数据库详细分析
»¨ÁË2ÖܶàµÄʱ¼ä°ÑecshopµÄÊý¾Ý¿â±í·ÖÎöÁËÏ£¬ecshop°æ±¾2.6.0¡£
2.6Óбí74¸ö2.7µ±ÖÐÓÐ86¸ö±í
ÈçÓÐç¢Â©»òÕß´íÎóµÄµØ·½»¶Ó´ó¼ÒÌí¼Ó£¬Ö¸Õý£¬Ð»Ð»£¡
±¾ÎĽ«³ÖÐø¸üÐÂ
×îеÄ2.7µ±ÖжàÁË¡ªad_custom/_affiliate_logµÈ±íÏ£Íû´ó¼Ò¸ú½ø
--phpMyAdminSQLDump
--version3.0.0-rc2
--
--Ö÷»ú:
localhost
--Éú³ÉÈÕÆÚ:
2008Äê11ÔÂ14ÈÕ17:
12
--·þÎñÆ÷°æ±¾:
5.1.29
--PHP°æ±¾:
5.2.6
SETSQL_MODE="NO_AUTO_VALUE_ON_ZERO";
/*!
40101SET@OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT*/;
/*!
40101SET@OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS*/;
/*!
40101SET@OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION*/;
/*!
40101SETNAMESutf8*/;
Êý¾Ý¿â:
`ecshop`
--------------------------------------------------------
--±íµÄ½á¹¹`ecs_account_log`
CREATETABLEIFNOTEXISTS`ecs_account_log`(
`log_id`mediumint(8)unsignedNOTNULLAUTO_INCREMENTCOMMENT'×ÔÔöIDºÅ',
`user_id`mediumint(8)unsignedNOTNULLCOMMENT'Óû§µÇ¼ºó±£´æÔÚsessionÖеÄidºÅ£¬¸úusers±íÖеÄuser_id¶ÔÓ¦',
`user_money`decimal(10,2)NOTNULLCOMMENT'Óû§¸Ã±Ê¼Ç¼µÄÓà¶î',
`frozen_money`decimal(10,2)NOTNULLCOMMENT'±»¶³½áµÄ×ʽð',
`rank_points`mediumint(9)NOTNULLCOMMENT'µÈ¼¶»ý·Ö£¬¸úÏû·Ñ»ý·ÖÊÇ·Ö¿ªµÄ',
`pay_points`mediumint(9)NOTNULLCOMMENT'Ïû·Ñ»ý·Ö£¬¸úµÈ¼¶»ý·ÖÊÇ·Ö¿ªµÄ',
`change_time`int(10)unsignedNOTNULLCOMMENT'¸Ã±Ê²Ù×÷·¢ÉúµÄʱ¼ä',
`change_desc`varchar(255)NOTNULLCOMMENT'¸Ã±Ê²Ù×÷µÄ±¸×¢£¬Ò»°ãÊÇ£¬³äÖµ»òÕßÌáÏÖ¡£Ò²¿ÉÊÇÊǹÜÀíÔ±ºǫ́дµÄÈκÎÔÚ±¸×¢',
`change_type`tinyint(3)unsignedNOTNULLCOMMENT'²Ù×÷ÀàÐÍ£¬0Ϊ³äÖµ£¬1ΪÌáÏÖ£¬2Ϊ¹ÜÀíÔ±µ÷½Ú£¬99ΪÆäËûÀàÐÍ',
PRIMARYKEY(`log_id`),
KEY`user_id`(`user_id`)
)ENGINE=MyISAMDEFAULTCHARSET=utf8ROW_FORMAT=DYNAMICCOMMENT='Óû§ÕʺÅÇé¿ö¼Ç¼±í£¬°üÀ¨×ʽðºÍ»ý·ÖµÈ'AUTO_INCREMENT=42;
--------------------------------------------------------
--±íµÄ½á¹¹`ecs_ad`
CREATETABLEIFNOTEXISTS`ecs_ad`(
`ad_id`smallint(5)unsignedNOTNULLAUTO_INCREMENTCOMMENT'×ÔÔöIDºÅ',
`position_id`smallint(5)unsignedNOTNULLDEFAULT'0'COMMENT'0,Õ¾Íâ¹ã¸æ£»´Ó1¿ªÊ¼´ú±íµÄÊǸùã¸æËù´¦µÄ¹ã¸æλ£¬Í¬±íad_positionÖеÄ×Ö¶Îposition_idµÄÖµ',
`media_type`tinyint(3)unsignedNOTNULLDEFAULT'0'COMMENT'¹ã¸æÀàÐÍ£¬0£¬Í¼Æ¬£»1£¬flash;2,´úÂ룻3£¬ÎÄ×Ö',
`ad_name`varchar(60)NOTNULLCOMMENT'¸ÃÌõ¹ã¸æ¼Ç¼µÄ¹ã¸æÃû³Æ',
`ad_link`varchar(255)NOTNULLCOMMENT'¹ã¸æÁ´½ÓµØÖ·',
`ad_code`textNOTNULLCOMMENT'¹ã¸æÁ´½ÓµÄ±íÏÖ£¬ÎÄ×Ö¹ã¸æ¾ÍÊÇÎÄ×Ö»òͼƬºÍflash¾ÍÊÇËüÃǵĵØÖ·£¬´úÂë¹ã¸æ¾ÍÊÇ´úÂëÄÚÈÝ',
`start_time`int(11)NOTNULLDEFAULT'0'COMMENT'¹ã¸æ¿ªÊ¼Ê±¼ä',
`end_time`int(11)NOTNULLDEFAULT'0'COMMENT'¹ã¸æ½áÊøʱ¼ä',
`link_man`varchar(60)NOTNULLCOMMENT'¹ã¸æÁªÏµÈË',
`link_email`varchar(60)NOTNULLCOMMENT'¹ã¸æÁªÏµÈ˵ÄÓÊÏä',
`link_phone`varchar(60)NOTNULLCOMMENT'¹ã¸æÁªÏµÈ˵ĵ绰',
`click_count`mediumint(8)unsignedNOTNULLDEFAULT'0'COMMENT'¸Ã¹ã¸æµã»÷Êý',
`enabled`tinyint(3)unsignedNOTNULLDEFAULT'1'COMMENT'¸Ã¹ã¸æÊÇ·ñ¹Ø±Õ£¬1£¬¿ªÆô£»0£¬¹Ø±Õ£»¹Ø±Õºó¹ã¸æ½«²»ÔÙÓÐЧ£¬Ö±ÖÁÖØпªÆô',
PRIMARYKEY(`ad_id`),
KEY`position_id`(`position_id`),
KEY`enabled`(`enabled`)
)ENGINE=MyISAMDEFAULTCHARSET=utf8ROW_FORMAT=DYNAMICCOMMENT='¹ã¸æÁбíÅäÖÃ±í£¬°üÀ¨Õ¾ÄÚÕ¾ÍâµÄͼƬ£¬ÎÄ×Ö£¬flash£¬´úÂë¹ã¸æ'AUTO_INCREMENT=6;
--------------------------------------------------------
--±íµÄ½á¹¹`ecs_admin_action`
CREATETABLEIFNOTEXISTS`ecs_admin_action`(
`action_id`tinyint(3)unsignedNOTNULLAUTO_INCREMENTCOMMENT'×ÔÔöIDºÅ',
`parent_id`tinyint(3)unsignedNOTNULLDEFAULT'0'COMMENT'¸ÃidÏîµÄ¸¸id£¬¶ÔÓ¦±¾±íµÄaction_id×Ö¶Î',
`action_code`varchar(20)NOTNULLCOMMENT'´ú±íȨÏÞµÄÓ¢ÎÄ×Ö·û´®£¬¶ÔÓ¦ººÎÄÔÚÓïÑÔÎļþÖУ¬Èç¹û¸Ã×Ö¶ÎÓÐij¸ö×Ö·û´®£¬¾Í±íʾÓиÃȨÏÞ',
PRIMARYKEY(`action_id`),
KEY`parent_id`(`parent_id`)
)ENGINE=MyISAMDEFAULTCHARSET=utf8ROW_FORMAT=DYNAMICCOMMENT='¹ÜÀíԱȨÏÞÁбíÊ÷'AUTO_INCREMENT=104;
--------------------------------------------------------
--±íµÄ½á¹¹`ecs_admin_log`
CREATETABLEIFNOTEXISTS`ecs_admin_log`(
`log_id`int(10)unsignedNOTNULLAUTO_INCREMENTCOMMENT'×ÔÔöIDºÅ',
`log_time`int(10)unsignedNOTNULLDEFAULT'0'COMMENT'дÈÕ־ʱ¼ä',
`user_id`tinyint(3)unsignedNOTNULLDEFAULT'0'COMMENT'¸ÃÈÕÖ¾Ëù¼Ç¼µÄ²Ù×÷Õßid£¬Í¬ecs_admin_userµÄuser_id',
`log_info`varchar(255)NOTNULLCOMMENT'¹ÜÀí²Ù×÷ÄÚÈÝ',
`ip_address`varchar(15)NOTNULLCOMMENT'¹ÜÀíÕߵǼip',
PRIMARYKEY(`log_id`),
KEY`log_time`(`log_time`),
KEY`user_id`(`user_id`)
)ENGINE=MyISAMDEFAULTCHARSET=utf8ROW_FORMAT=DYNAMICCOMMENT='¹ÜÀíÔ±²Ù×÷ÈÕÖ¾±í'AUTO_INCREMENT=158;
--------------------------------------------------------
--±íµÄ½á¹¹`ecs_admin_message`
CREATETABLEIFNOTEXISTS`ecs_admin_message`(
`message_id`smallint(5)unsignedNOTNULLAUTO_INCREMENTCOMMENT'×ÔÔöIDºÅ',
`sender_id`tinyint(3)unsignedNOTNULLDEFAULT'0'COMMENT'·¢Ë͸ÃÁôÑԵĹÜÀíÔ±id£¬Í¬ecs_admin_userµÄuser_id',
`receiver_id`tinyint(3)unsignedNOTNULLDEFAULT'0'COMMENT'½ÓÊÕÏûÏ¢µÄ¹ÜÀíÔ±id£¬Í¬ecs_admin_userµÄuser_id£¬Èç¹ûÊǸø¶à¸ö¹ÜÀíÔ±·¢ËÍ£¬Ôòͬһ¸öÏûÏ¢¸øÿ¸ö¹ÜÀíÔ±id·¢ËÍÒ»Ìõ',
`sent_time`int(11)unsignedNOTNULLDEFAULT'0'COMMENT'ÁôÑÔ·¢ËÍʱ¼ä',
`read_time`int(11)unsignedNOTNULLDEFAULT'0'COMMENT'ÁôÑÔÔĶÁʱ¼ä',
`readed`tinyint
(1)unsignedNOTNULLDEFAULT'0'COMMENT'ÁôÑÔÊÇ·ñÔĶÁ£¬1£¬ÒÑÔĶÁ£»0£¬Î´ÔĶÁ',
`deleted`tinyint
(1)unsignedNOTNULLDEFAULT'0'COMMENT'ÁôÑÔÊÇ·ñÒѾÊÇ·ñÒѾ±»É¾³ý£¬1£¬ÒÑɾ³ý£»0£¬Î´É¾³ý',
`title`varchar(150)NOTNULLCOMMENT'ÁôÑÔµÄÖ÷Ìâ',
`message`textNOTNULLCOMMENT'ÁôÑÔµÄÄÚÈÝ',
PRIMARYKEY(`message_id`),
KEY`sender_id`(`sender_id`,`receiver_id`),
KEY`receiver_id`(`receiver_id`)
)ENGINE=MyISAMDEFAULTCHARSET=utf8ROW_FORMAT=DYNAMICCOMMENT='¹ÜÀíÔ±ÁôÑԼǼ±í'AUTO_INCREMENT=7;
--------------------------------------------------------
--±íµÄ½á¹¹`ecs_admin_user`
CREATETABLEIFNOTEXISTS`ecs_admin_user`(
`user_id`smallint(5)unsignedNOTNULLAUTO_INCREMENTCOMMENT'×ÔÔöIDºÅ£¬¹ÜÀíÔ±´úºÅ',
`user_name`varchar(60)NOTNULLCOMMENT'¹ÜÀíÔ±µÇ¼Ãû',
`email`varchar(60)NOTNULLCOMMENT'¹ÜÀíÔ±ÓÊÏä',
`password`varchar(32)NOTNULLCOMMENT'¹ÜÀíÔ±µÇ¼ÃØÃܼÓÃÜ´®',
`add_time`int(11)NOTNULLDEFAULT'0'COMMENT'¹ÜÀíÔ±Ìí¼Óʱ¼ä',
`last_login`int(11)NOTNULLDEFAULT'0'COMMENT'¹ÜÀíÔ±×îºóÒ»´ÎµÇ¼ʱ¼ä',
`last_ip`varchar(15)NOTNULLCOMMENT'¹ÜÀíÔ±×îºóÒ»´ÎµÇ¼ip',
`action_list`textNOTNULLCOMMENT'¹ÜÀíÔ±¹ÜÀíȨÏÞÁбí',
`nav_list`textNOTNULLCOMMENT'¹ÜÀíÔ±µ¼º½À¸ÅäÖÃÏî',
`lang_type`varchar(50)NOTNULL,
`agency_id`smallint(5)unsignedNOTNULLCOMMENT'¸Ã¹ÜÀíÔ±¸ºÔðµÄ°ìÊ´¦µÄid£¬Í¬ecs_agencyµÄagency_id×ֶΡ£Èç¹û¹ÜÀíԱû¸ºÔð°ìÊ´¦£¬Ôò´Ë´¦Îª0',
`todolist`longtextCOMMENT'¼Çʱ¾¼Ç¼µÄÊý¾Ý',
PRIMARYKEY(`user_id`),
KEY`user_name`(`user_name`),
KEY`agency_id`(`agency_id`)
)ENGINE=MyISAMDEFAULTCHARSET=utf8ROW_FORMAT=DYNAMICCOMMENT='¹ÜÀíÔ±×ÊÁÏȨÏÞÁбí'AUTO_INCREMENT=4;
--------------------------------------------------------
--±íµÄ½á¹¹`ecs_adsense`
CREATETABLEIFNOTEXISTS`ecs_adsense`(
`from_ad`smallint(5)NOTNULLDEFAULT'0'COMMENT'¹ã¸æ´úºÅ£¬-1ÊÇÕ¾Íâ¹ã¸æ£¬Èç¹ûÊÇÕ¾ÄÚ¹ã¸æÔòΪecs_adµÄad_id',
`referer`varchar(255)NOTNULLCOMMENT'Ò³ÃæÀ´Ô´',
`clicks`int(10)unsignedNOTNULLDEFAULT'0'COMMENT'µã»÷ÂÊ',
KEY`from_ad`(`from_ad`)
)ENGINE=MyISAMDEFAULTCHARSET=utf8ROW_FORMAT=DYNAMICCOMMENT='¹ã¸æµã»÷ÂÊͳ¼Æ±í';
--------------------------------------------------------
--±íµÄ½á¹¹`ecs_ad_position`
CREATETABLEIFNOTEXISTS`ecs_ad_position`(
`position_id`tinyint(3)unsignedNOTNULLAUTO_INCREMENTCOMMENT'¹ã¸æλ×ÔÔöid',
`position_name`varchar(60)NOTNULLCOMMENT'¹ã¸æλÃû³Æ',
`ad_width`smallint(5)unsignedNOTNULLDEFAULT'0'COMMENT'¹ã¸æλ¿í¶È',
`ad_height`smallint(5)unsignedNOTNULLDEFAULT'0'COMMENT'¹ã¸æλ¸ß¶È',
`position_desc`varchar(255)NOTNULLCOMMENT'¹ã¸æλÃèÊö',
`position_style`textNOTNULLCOMMENT'¹ã¸æλģ°å´úÂë',
PRIMARYKEY(`position_id`)
)ENGINE=MyISAMDEFAULTCHARSET=utf8ROW_FORMAT=DYNAMICCOMMENT='¹ã¸æλÖÃÅäÖñí'AUTO_INCREMENT=2;
--------------------------------------------------------
--±íµÄ½á¹¹`ecs_affiliate_log`
CREATETABLEIFNOTEXISTS`ecs_affiliate_log`(
`log_id`mediumint(8)NOTNULLAUTO_INCREMENT,
`order_id`mediumint(8)NOTNULL,
`time`int(10)NOTNULL,
`user_id`mediumint(8)NOTNULL,
`user_name`varchar(60)DEFAULTNULL,
`money`decimal(10,2)NOTNULLDEFAULT'0.00',
`point`int(10)NOTNULLDEFAULT'0',
`separate_type`tinyint
(1)NOTNULLDEFAULT'0',
PRIMARYKEY(`log_id`)
)ENGINE=MyISAMDEFAULTCHARSET=utf8ROW_FORMAT=DYNAMICCOMMENT='·Ö³ÉÏà¹ØµÄ±í£¬»¹Ã»Ñо¿Í¸'AUTO_INCREMENT=1;
--------------------------------------------------------
--±íµÄ½á¹¹`ecs_agency`
CREATETABLEIFNOTEXISTS`ecs_agency`(
`agency_id`smallint(5)unsignedNOTNULLAUTO_INCREMENTCOMMENT'°ìÊ´¦ID',
`agency_name`varchar(255)NOTNULLCOMMENT'°ìÊ´¦Ãû×Ö',
`agency_desc`textNOTNULLCOMMENT'°ìÊ´¦ÃèÊö',
PRIMARYKEY(`agency_id`),
KEY`agency_name`(`agency_name`)
)ENGINE=MyISAMDEFAULTCHARSET=utf8COMMENT='°ìÊ´¦ÐÅÏ¢'AUTO_INCREMENT=5;
--------------------------------------------------------
--±íµÄ½á¹¹`ecs_area_region`
CREATETABLEIFNOTEXISTS`ecs_area_region`(
`shipping_area_id`smallint(5)unsignedNOTNULLDEFAULT'0'COMMENT'ÅäËÍÇøÓòµÄidºÅ£¬µÈͬÓÚecs_shipping_areaµÄshipping_area_idµÄÖµ',
`region_id`smallint(5)unsignedNOTNULLDEFAULT'0'COMMENT'µØÇøÁÐ±í£¬µÈͬÓÚecs_regionµÄregion_id',
PRIMARYKEY(`shipping_area_id`,`region_id`)
)ENGINE=MyISAMDEFAULTCHARSET=utf8ROW_FORMAT=FIXEDCOMMENT='¼Ç¼±íecs_shipping_areaÖеÄshipping_area_nameµÄµØÇøÃû°üÀ¨ecs_regionÖеijÇÊÐ';
--------------------------------------------------------
--±íµÄ½á¹¹`ecs_article`
CREATETABLEIFNOTEXISTS`ecs_article`(
`article_id`medi