xuanxuan15.0.sql 6.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170
  1. CREATE TABLE IF NOT EXISTS `zt_im_chat` (
  2. `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT,
  3. `gid` char(40) NOT NULL DEFAULT '',
  4. `name` varchar(60) NOT NULL DEFAULT '',
  5. `type` varchar(20) NOT NULL DEFAULT 'group',
  6. `admins` varchar(255) NOT NULL DEFAULT '',
  7. `committers` varchar(255) NOT NULL DEFAULT '',
  8. `subject` mediumint(8) unsigned NOT NULL DEFAULT 0,
  9. `public` enum('0', '1') NOT NULL DEFAULT '0',
  10. `createdBy` varchar(30) NOT NULL DEFAULT '',
  11. `createdDate` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
  12. `editedBy` varchar(30) NOT NULL DEFAULT '',
  13. `editedDate` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
  14. `lastActiveTime` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
  15. `lastMessage` int(11) unsigned NOT NULL DEFAULT 0,
  16. `dismissDate` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
  17. `pinnedMessages` text NOT NULL DEFAULT '',
  18. PRIMARY KEY (`id`),
  19. KEY `gid` (`gid`),
  20. KEY `name` (`name`),
  21. KEY `type` (`type`),
  22. KEY `public` (`public`),
  23. KEY `createdBy` (`createdBy`),
  24. KEY `editedBy` (`editedBy`)
  25. ) ENGINE=MyISAM;
  26. CREATE TABLE IF NOT EXISTS `zt_im_chatuser` (
  27. `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT,
  28. `cgid` char(40) NOT NULL DEFAULT '',
  29. `user` mediumint(8) NOT NULL DEFAULT 0,
  30. `order` smallint(5) NOT NULL DEFAULT 0,
  31. `star` enum('0', '1') NOT NULL DEFAULT '0',
  32. `hide` enum('0', '1') NOT NULL DEFAULT '0',
  33. `mute` enum('0', '1') NOT NULL DEFAULT '0',
  34. `freeze` enum('0', '1') NOT NULL DEFAULT '0',
  35. `join` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
  36. `quit` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
  37. `category` varchar(40) NOT NULL DEFAULT '',
  38. PRIMARY KEY (`id`),
  39. KEY `cgid` (`cgid`),
  40. KEY `user` (`user`),
  41. KEY `order` (`order`),
  42. KEY `star` (`star`),
  43. KEY `hide` (`hide`),
  44. UNIQUE KEY `chatuser` (`cgid`, `user`)
  45. ) ENGINE=MyISAM;
  46. CREATE TABLE IF NOT EXISTS `zt_im_client` (
  47. `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  48. `version` char(30) NOT NULL DEFAULT '',
  49. `desc` varchar(100) NOT NULL DEFAULT '',
  50. `changeLog` text NOT NULL,
  51. `strategy` varchar(10) NOT NULL DEFAULT '',
  52. `downloads` text NOT NULL,
  53. `createdDate` datetime NOT NULL,
  54. `createdBy` varchar(30) NOT NULL DEFAULT '',
  55. `editedDate` datetime NOT NULL,
  56. `editedBy` varchar(30) NOT NULL DEFAULT '',
  57. `status` enum('released','wait') NOT NULL DEFAULT 'wait',
  58. PRIMARY KEY (`id`)
  59. ) ENGINE=MyISAM;
  60. CREATE TABLE IF NOT EXISTS `zt_im_message` (
  61. `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  62. `gid` char(40) NOT NULL DEFAULT '',
  63. `cgid` char(40) NOT NULL DEFAULT '',
  64. `user` varchar(30) NOT NULL DEFAULT '',
  65. `date` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
  66. `type` enum('normal', 'broadcast', 'notify', 'bulletin') NOT NULL DEFAULT 'normal',
  67. `content` text NOT NULL DEFAULT '',
  68. `contentType` enum('text', 'plain', 'emotion', 'image', 'file', 'object', 'code') NOT NULL DEFAULT 'text',
  69. `data` text NOT NULL DEFAULT '',
  70. `deleted` enum('0','1') NOT NULL DEFAULT '0',
  71. PRIMARY KEY (`id`),
  72. KEY `mgid` (`gid`),
  73. KEY `mcgid` (`cgid`),
  74. KEY `muser` (`user`),
  75. KEY `mtype` (`type`)
  76. ) ENGINE=MyISAM;
  77. CREATE TABLE IF NOT EXISTS `zt_im_message_backup` (
  78. `id` int(11) unsigned NOT NULL,
  79. `gid` char(40) NOT NULL DEFAULT '',
  80. `cgid` char(40) NOT NULL DEFAULT '',
  81. `user` varchar(30) NOT NULL DEFAULT '',
  82. `date` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
  83. `type` enum('normal', 'broadcast', 'notify') NOT NULL DEFAULT 'normal',
  84. `content` text NOT NULL DEFAULT '',
  85. `contentType` enum('text', 'plain', 'emotion', 'image', 'file', 'object', 'code') NOT NULL DEFAULT 'text',
  86. `data` text NOT NULL DEFAULT '',
  87. `deleted` enum('0','1') NOT NULL DEFAULT '0'
  88. ) ENGINE=MyISAM;
  89. CREATE TABLE IF NOT EXISTS `zt_im_message_index` (
  90. `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT,
  91. `tableName` char(64) NOT NULL,
  92. `start` int(11) unsigned NOT NULL,
  93. `end` int(11) unsigned NOT NULL,
  94. `startDate` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
  95. `endDate` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
  96. `chats` text NOT NULL,
  97. PRIMARY KEY (`id`),
  98. KEY `tableName` (`tableName`),
  99. KEY `start` (`start`),
  100. KEY `end` (`end`),
  101. KEY `startDate` (`startDate`),
  102. KEY `endDate` (`endDate`)
  103. ) ENGINE=MyISAM;
  104. CREATE TABLE IF NOT EXISTS `zt_im_chat_message_index` (
  105. `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT,
  106. `gid` char(40) NOT NULL,
  107. `tableName` char(64) NOT NULL,
  108. `start` int(11) unsigned NOT NULL,
  109. `end` int(11) unsigned NOT NULL,
  110. `startDate` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
  111. `endDate` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
  112. `count` mediumint(8) unsigned NOT NULL,
  113. PRIMARY KEY (`id`),
  114. UNIQUE KEY `chattable` (`gid`,`tableName`),
  115. KEY `start` (`start`),
  116. KEY `end` (`end`),
  117. KEY `startDate` (`startDate`),
  118. KEY `endDate` (`endDate`)
  119. ) ENGINE=MyISAM;
  120. CREATE TABLE IF NOT EXISTS `zt_im_messagestatus` (
  121. `user` mediumint(8) NOT NULL DEFAULT 0,
  122. `message` int(11) unsigned NOT NULL,
  123. `status` enum('waiting','sent','readed','deleted') NOT NULL DEFAULT 'waiting',
  124. UNIQUE KEY `user` (`user`,`message`)
  125. ) ENGINE=MyISAM;
  126. CREATE TABLE IF NOT EXISTS `zt_im_queue` (
  127. `id` mediumint(8) unsigned NOT NULL auto_increment,
  128. `type` char(30) NOT NULL,
  129. `content` text NOT NULL,
  130. `addDate` datetime NOT NULL,
  131. `processDate` datetime NOT NULL,
  132. `result` text NOT NULL,
  133. `status` char(30) NOT NULL,
  134. PRIMARY KEY (`id`)
  135. ) ENGINE=MyISAM;
  136. CREATE TABLE IF NOT EXISTS `zt_im_conference` (
  137. `id` mediumint(8) unsigned NOT NULL auto_increment,
  138. `rid` char(24) NOT NULL DEFAULT '',
  139. `cgid` char(40) NOT NULL DEFAULT '',
  140. `status` enum('closed','open') NOT NULL DEFAULT 'closed',
  141. `participants` text NOT NULL,
  142. `invitee` text NOT NULL,
  143. `openedBy` mediumint(8) NOT NULL DEFAULT 0,
  144. `openedDate` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
  145. PRIMARY KEY (`id`)
  146. ) ENGINE=MyISAM;
  147. CREATE TABLE IF NOT EXISTS `zt_im_conferenceaction` (
  148. `id` mediumint(8) unsigned NOT NULL auto_increment,
  149. `rid` char(24) NOT NULL DEFAULT '',
  150. `type` enum('create','join','leave','close') NOT NULL DEFAULT 'create',
  151. `user` mediumint(8) NOT NULL DEFAULT 0,
  152. `date` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
  153. `device` char(40) NOT NULL DEFAULT 'default',
  154. PRIMARY KEY (`id`)
  155. ) ENGINE=MyISAM;
  156. CREATE TABLE IF NOT EXISTS `zt_im_userdevice` (
  157. `id` mediumint(8) unsigned NOT NULL auto_increment,
  158. `user` mediumint(8) NOT NULL DEFAULT 0,
  159. `device` char(40) NOT NULL DEFAULT 'default',
  160. `deviceID` char(40) NOT NULL DEFAULT '',
  161. `token` char(64) NOT NULL DEFAULT '',
  162. `validUntil` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
  163. `lastLogin` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
  164. `lastLogout` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
  165. PRIMARY KEY (`id`),
  166. KEY `user` (`user`),
  167. KEY `lastLogin` (`lastLogin`),
  168. KEY `lastLogout` (`lastLogout`),
  169. UNIQUE KEY `userdevice` (`user`, `device`)
  170. ) ENGINE=MyISAM;