What is the key used when creating a table in wordpress/emlog?

Source: Internet
Author: User
{Code...}, especially in the later code, what does KEYgid (tid) mean?
CREATE TABLE $wpdb->blogs (  blog_id bigint(20) NOT NULL auto_increment,  site_id bigint(20) NOT NULL default '0',  domain varchar(200) NOT NULL default '',  path varchar(100) NOT NULL default '',  registered datetime NOT NULL default '0000-00-00 00:00:00',  last_updated datetime NOT NULL default '0000-00-00 00:00:00',  public tinyint(2) NOT NULL default '1',  archived tinyint(2) NOT NULL default '0',  mature tinyint(2) NOT NULL default '0',  spam tinyint(2) NOT NULL default '0',  deleted tinyint(2) NOT NULL default '0',  lang_id int(11) NOT NULL default '0',  PRIMARY KEY  (blog_id),  KEY domain (domain(50),path(5)),  KEY lang_id (lang_id)) $charset_collate;CREATE TABLE {$db_prefix}reply (  id int(10) unsigned NOT NULL auto_increment,  tid int(10) unsigned NOT NULL default '0',  date bigint(20) NOT NULL,  name varchar(20) NOT NULL default '',  content text NOT NULL,  hide enum('n','y') NOT NULL default 'n',  ip varchar(128) NOT NULL default '',  PRIMARY KEY  (id),  KEY gid (tid),  KEY hide (hide))

Especially in the later code,KEY gid (tid)What does that mean?

Reply content:
CREATE TABLE $wpdb->blogs (  blog_id bigint(20) NOT NULL auto_increment,  site_id bigint(20) NOT NULL default '0',  domain varchar(200) NOT NULL default '',  path varchar(100) NOT NULL default '',  registered datetime NOT NULL default '0000-00-00 00:00:00',  last_updated datetime NOT NULL default '0000-00-00 00:00:00',  public tinyint(2) NOT NULL default '1',  archived tinyint(2) NOT NULL default '0',  mature tinyint(2) NOT NULL default '0',  spam tinyint(2) NOT NULL default '0',  deleted tinyint(2) NOT NULL default '0',  lang_id int(11) NOT NULL default '0',  PRIMARY KEY  (blog_id),  KEY domain (domain(50),path(5)),  KEY lang_id (lang_id)) $charset_collate;CREATE TABLE {$db_prefix}reply (  id int(10) unsigned NOT NULL auto_increment,  tid int(10) unsigned NOT NULL default '0',  date bigint(20) NOT NULL,  name varchar(20) NOT NULL default '',  content text NOT NULL,  hide enum('n','y') NOT NULL default 'n',  ip varchar(128) NOT NULL default '',  PRIMARY KEY  (id),  KEY gid (tid),  KEY hide (hide))

Especially in the later code,KEY gid (tid)What does that mean?

From http://m.blog.csdn.net/article/details? Id = 51778816
Key (sid, tid) indicates the Union primary key. the two fields must be unique.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.