install.sql 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481
  1. CREATE TABLE IF NOT EXISTS `__PREFIX__cms_addondownload` (
  2. `id` int(10) NOT NULL,
  3. `content` longtext NOT NULL,
  4. `os` set('windows','linux','mac','ubuntu') DEFAULT '' COMMENT '操作系统',
  5. `version` varchar(255) DEFAULT '' COMMENT '最新版本',
  6. `filesize` varchar(255) DEFAULT '' COMMENT '文件大小',
  7. `language` set('zh-cn','en') DEFAULT '' COMMENT '语言',
  8. `downloadurl` varchar(1500) DEFAULT '' COMMENT '下载地址',
  9. `screenshots` varchar(1500) DEFAULT '' COMMENT '预览截图',
  10. `downloads` varchar(10) DEFAULT '0' COMMENT '下载次数',
  11. PRIMARY KEY (`id`)
  12. ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='下载';
  13. --
  14. -- 表的结构 `__PREFIX__cms_addonnews`
  15. --
  16. CREATE TABLE IF NOT EXISTS `__PREFIX__cms_addonnews` (
  17. `id` int(10) NOT NULL,
  18. `content` longtext NOT NULL,
  19. `author` varchar(50) DEFAULT '' COMMENT '作者',
  20. PRIMARY KEY (`id`)
  21. ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='新闻';
  22. --
  23. -- 表的结构 `__PREFIX__cms_addonproduct`
  24. --
  25. CREATE TABLE IF NOT EXISTS `__PREFIX__cms_addonproduct` (
  26. `id` int(10) NOT NULL,
  27. `content` longtext NOT NULL,
  28. `productdata` varchar(1500) DEFAULT '' COMMENT '产品列表',
  29. PRIMARY KEY (`id`)
  30. ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='产品表';
  31. --
  32. -- 表的结构 `__PREFIX__cms_archives`
  33. --
  34. CREATE TABLE IF NOT EXISTS `__PREFIX__cms_archives` (
  35. `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT,
  36. `user_id` int(10) UNSIGNED NOT NULL DEFAULT '0' COMMENT '会员ID',
  37. `channel_id` int(10) UNSIGNED NOT NULL DEFAULT '0' COMMENT '栏目ID',
  38. `channel_ids` varchar(255) DEFAULT '' COMMENT '副栏目ID集合',
  39. `model_id` int(10) NOT NULL DEFAULT '0' COMMENT '模型ID',
  40. `special_ids` varchar(255) DEFAULT '' COMMENT '专题ID集合',
  41. `admin_id` int(10) unsigned DEFAULT '0' COMMENT '管理员ID',
  42. `title` varchar(255) DEFAULT '' COMMENT '文章标题',
  43. `flag` varchar(100) DEFAULT '' COMMENT '标志',
  44. `style` varchar(100) NULL DEFAULT '' COMMENT '样式',
  45. `image` varchar(255) DEFAULT '' COMMENT '缩略图',
  46. `images` varchar(1500) DEFAULT '' COMMENT '组图',
  47. `seotitle` varchar(255) DEFAULT '' COMMENT 'SEO标题',
  48. `keywords` varchar(255) DEFAULT '' COMMENT '关键字',
  49. `description` varchar(255) DEFAULT '' COMMENT '描述',
  50. `tags` varchar(255) DEFAULT '' COMMENT 'TAG',
  51. `price` decimal(10,2) unsigned DEFAULT '0.00' COMMENT '价格',
  52. `outlink` varchar(255) DEFAULT '' COMMENT '外部链接',
  53. `weigh` int(10) NOT NULL DEFAULT '0' COMMENT '权重',
  54. `views` int(10) UNSIGNED NOT NULL DEFAULT '0' COMMENT '浏览次数',
  55. `comments` int(10) UNSIGNED NOT NULL DEFAULT '0' COMMENT '评论次数',
  56. `likes` int(10) UNSIGNED NOT NULL DEFAULT '0' COMMENT '点赞数',
  57. `dislikes` int(10) UNSIGNED NOT NULL DEFAULT '0' COMMENT '点踩数',
  58. `diyname` varchar(100) DEFAULT '' COMMENT '自定义URL',
  59. `isguest` tinyint(1) unsigned DEFAULT '1' COMMENT '是否访客访问',
  60. `iscomment` tinyint(1) unsigned DEFAULT '1' COMMENT '是否允许评论',
  61. `createtime` int(10) DEFAULT NULL COMMENT '创建时间',
  62. `updatetime` int(10) DEFAULT NULL COMMENT '更新时间',
  63. `publishtime` int(10) DEFAULT NULL COMMENT '发布时间',
  64. `deletetime` int(10) DEFAULT NULL COMMENT '删除时间',
  65. `memo` varchar(100) DEFAULT '' COMMENT '备注',
  66. `status` enum('normal','hidden','rejected','pulloff') NOT NULL DEFAULT 'normal' COMMENT '状态',
  67. PRIMARY KEY (`id`),
  68. KEY `channel_id` (`channel_id`),
  69. KEY `channel_ids` (`channel_ids`),
  70. KEY `diyname` (`diyname`),
  71. KEY `status` (`channel_id`,`status`),
  72. KEY `channel` (`channel_id`,`weigh`,`id`),
  73. KEY `weigh` (`weigh`,`id`)
  74. ) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4 COMMENT='内容表';
  75. --
  76. -- 表的结构 `__PREFIX__cms_autolink`
  77. --
  78. CREATE TABLE IF NOT EXISTS `__PREFIX__cms_autolink` (
  79. `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  80. `title` varchar(100) DEFAULT NULL COMMENT '标题',
  81. `url` varchar(255) DEFAULT '' COMMENT '链接',
  82. `target` enum('self','blank') DEFAULT 'blank' COMMENT '打开方式',
  83. `weigh` int(10) DEFAULT '0' COMMENT '排序',
  84. `views` int(10) unsigned DEFAULT '0' COMMENT '点击次数',
  85. `createtime` int(10) DEFAULT NULL COMMENT '添加时间',
  86. `updatetime` int(10) DEFAULT NULL COMMENT '更新时间',
  87. `status` enum('normal','hidden') DEFAULT 'normal' COMMENT '状态',
  88. PRIMARY KEY (`id`)
  89. ) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4 COMMENT='自动链接表';
  90. --
  91. -- 表的结构 `__PREFIX__cms_block`
  92. --
  93. CREATE TABLE IF NOT EXISTS `__PREFIX__cms_block` (
  94. `id` smallint(8) UNSIGNED NOT NULL AUTO_INCREMENT,
  95. `type` varchar(30) DEFAULT '' COMMENT '类型',
  96. `name` varchar(50) DEFAULT '' COMMENT '名称',
  97. `title` varchar(100) DEFAULT '' COMMENT '标题',
  98. `image` varchar(100) DEFAULT '' COMMENT '图片',
  99. `url` varchar(100) DEFAULT '' COMMENT '链接',
  100. `content` mediumtext COMMENT '内容',
  101. `parsetpl` tinyint(1) UNSIGNED NULL DEFAULT 0 COMMENT '解析模板标签',
  102. `weigh` int(10) NULL DEFAULT 0 COMMENT '权重',
  103. `createtime` int(10) DEFAULT NULL COMMENT '添加时间',
  104. `updatetime` int(10) DEFAULT NULL COMMENT '更新时间',
  105. `begintime` int(10) DEFAULT NULL COMMENT '开始时间',
  106. `endtime` int(10) DEFAULT NULL COMMENT '结束时间',
  107. `status` enum('normal','hidden') NOT NULL DEFAULT 'normal' COMMENT '状态',
  108. PRIMARY KEY (`id`)
  109. ) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4 COMMENT='区块表';
  110. --
  111. -- 表的结构 `__PREFIX__cms_channel`
  112. --
  113. CREATE TABLE IF NOT EXISTS `__PREFIX__cms_channel` (
  114. `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT,
  115. `type` enum('channel','page','link','list') NOT NULL COMMENT '类型',
  116. `model_id` int(10) UNSIGNED NOT NULL DEFAULT '0' COMMENT '模型ID',
  117. `parent_id` int(10) UNSIGNED NOT NULL DEFAULT '0' COMMENT '父ID',
  118. `name` varchar(30) DEFAULT '' COMMENT '名称',
  119. `image` varchar(100) DEFAULT '' COMMENT '图片',
  120. `flag` varchar(100) DEFAULT '' COMMENT '标志',
  121. `seotitle` varchar(255) DEFAULT '' COMMENT 'SEO标题',
  122. `keywords` varchar(255) DEFAULT '' COMMENT '关键字',
  123. `description` varchar(255) DEFAULT '' COMMENT '描述',
  124. `diyname` varchar(100) DEFAULT '' COMMENT '自定义名称',
  125. `outlink` varchar(255) DEFAULT '' COMMENT '外部链接',
  126. `items` mediumint(8) UNSIGNED NOT NULL DEFAULT '0' COMMENT '文章数量',
  127. `weigh` int(10) NOT NULL DEFAULT '0' COMMENT '权重',
  128. `channeltpl` varchar(100) DEFAULT '' COMMENT '栏目页模板',
  129. `listtpl` varchar(100) DEFAULT '' COMMENT '列表页模板',
  130. `showtpl` varchar(100) DEFAULT '' COMMENT '详情页模板',
  131. `pagesize` smallint(5) NOT NULL DEFAULT '0' COMMENT '分页大小',
  132. `vip` tinyint(1) UNSIGNED NULL DEFAULT '0' COMMENT 'VIP',
  133. `listtype` tinyint(1) unsigned DEFAULT '0' COMMENT '列表数据类型',
  134. `iscontribute` tinyint(1) NOT NULL DEFAULT '0' COMMENT '是否可投稿',
  135. `isnav` tinyint(1) NOT NULL DEFAULT '1' COMMENT '是否导航显示',
  136. `createtime` int(10) DEFAULT NULL COMMENT '创建时间',
  137. `updatetime` int(10) DEFAULT NULL COMMENT '更新时间',
  138. `status` enum('normal','hidden') NOT NULL DEFAULT 'normal' COMMENT '状态',
  139. PRIMARY KEY (`id`),
  140. UNIQUE KEY `diyname` (`diyname`),
  141. KEY `type` (`type`),
  142. KEY `weigh` (`weigh`,`id`),
  143. KEY `parent_id` (`parent_id`)
  144. ) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4 COMMENT='栏目表';
  145. --
  146. -- 表的结构 `__PREFIX__cms_channel_admin`
  147. --
  148. CREATE TABLE `__PREFIX__cms_channel_admin` (
  149. `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  150. `admin_id` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '管理员ID',
  151. `channel_id` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '栏目ID',
  152. PRIMARY KEY (`id`),
  153. UNIQUE KEY `admin_id` (`admin_id`,`channel_id`)
  154. ) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4 COMMENT='栏目权限表';
  155. --
  156. -- 表的结构 `__PREFIX__cms_collection`
  157. --
  158. CREATE TABLE IF NOT EXISTS `__PREFIX__cms_collection` (
  159. `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  160. `type` enum('archives','special','page','diyform') DEFAULT NULL COMMENT '类型',
  161. `aid` int(10) unsigned DEFAULT '0' COMMENT '关联ID',
  162. `user_id` int(10) DEFAULT NULL COMMENT '会员ID',
  163. `title` varchar(255) DEFAULT NULL COMMENT '收藏标题',
  164. `image` varchar(255) DEFAULT NULL COMMENT '图片',
  165. `url` varchar(255) DEFAULT NULL COMMENT 'URL',
  166. `createtime` int(10) DEFAULT NULL COMMENT '添加时间',
  167. `updatetime` int(10) DEFAULT NULL COMMENT '更新时间',
  168. PRIMARY KEY (`id`),
  169. UNIQUE KEY `aid` (`type`,`aid`,`user_id`)
  170. ) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4 COMMENT='收藏表';
  171. --
  172. -- 表的结构 `__PREFIX__cms_comment`
  173. --
  174. CREATE TABLE IF NOT EXISTS `__PREFIX__cms_comment` (
  175. `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT 'ID',
  176. `user_id` int(10) UNSIGNED NOT NULL DEFAULT '0' COMMENT '会员ID',
  177. `type` enum('archives','page', 'special') NOT NULL DEFAULT 'archives' COMMENT '类型',
  178. `aid` int(10) UNSIGNED NOT NULL DEFAULT '0' COMMENT '关联ID',
  179. `pid` int(10) NOT NULL DEFAULT '0' COMMENT '父ID',
  180. `content` longtext COMMENT '内容',
  181. `comments` int(10) UNSIGNED NOT NULL DEFAULT '0' COMMENT '评论数',
  182. `ip` varchar(50) DEFAULT '' COMMENT 'IP',
  183. `useragent` varchar(255) DEFAULT '' COMMENT 'User Agent',
  184. `subscribe` tinyint(1) UNSIGNED NOT NULL DEFAULT '0' COMMENT '订阅',
  185. `createtime` int(10) UNSIGNED NOT NULL DEFAULT '0' COMMENT '创建时间',
  186. `updatetime` int(10) UNSIGNED NOT NULL DEFAULT '0' COMMENT '更新时间',
  187. `deletetime` int(10) DEFAULT NULL COMMENT '删除时间',
  188. `status` enum('normal','hidden') NOT NULL DEFAULT 'normal' COMMENT '状态',
  189. PRIMARY KEY (`id`),
  190. KEY `post_id` (`aid`,`pid`) USING BTREE
  191. ) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4 COMMENT='评论表';
  192. --
  193. -- 表的结构 `__PREFIX__cms_diyform`
  194. --
  195. CREATE TABLE IF NOT EXISTS `__PREFIX__cms_diyform`(
  196. `id` smallint(5) unsigned NOT NULL AUTO_INCREMENT,
  197. `admin_id` int(10) unsigned DEFAULT '0' COMMENT '管理员ID',
  198. `name` char(30) DEFAULT '' COMMENT '表单名称',
  199. `title` varchar(100) DEFAULT NULL COMMENT '标题',
  200. `seotitle` varchar(255) DEFAULT '' COMMENT 'SEO标题',
  201. `keywords` varchar(100) DEFAULT NULL COMMENT '关键字',
  202. `description` varchar(255) DEFAULT NULL COMMENT '描述',
  203. `table` varchar(50) DEFAULT '' COMMENT '表名',
  204. `fields` text COMMENT '字段列表',
  205. `needlogin` tinyint(1) NOT NULL DEFAULT '0' COMMENT '是否需要登录',
  206. `isedit` tinyint(1) unsigned DEFAULT '0' COMMENT '是否允许编辑',
  207. `iscaptcha` tinyint(1) unsigned DEFAULT '0' COMMENT '是否启用验证码',
  208. `successtips` varchar(255) DEFAULT NULL COMMENT '成功提示文字',
  209. `redirecturl` varchar(255) DEFAULT NULL COMMENT '成功后跳转链接',
  210. `posttpl` varchar(50) DEFAULT '' COMMENT '表单页模板',
  211. `listtpl` varchar(50) DEFAULT '' COMMENT '列表页模板',
  212. `showtpl` varchar(50) DEFAULT '' COMMENT '详情页模板',
  213. `diyname` varchar(100) DEFAULT NULL COMMENT '自定义名称',
  214. `usermode` enum('all','user') DEFAULT 'all' COMMENT '用户筛选模式',
  215. `statusmode` enum('all','normal','hidden') DEFAULT 'all' COMMENT '状态筛选模式',
  216. `createtime` int(10) DEFAULT NULL COMMENT '创建时间',
  217. `updatetime` int(10) DEFAULT NULL COMMENT '更新时间',
  218. `setting` varchar(1500) DEFAULT NULL COMMENT '表单配置',
  219. `status` enum('normal','hidden') DEFAULT 'hidden' COMMENT '状态',
  220. PRIMARY KEY (`id`),
  221. KEY `diyname` (`diyname`)
  222. ) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4 COMMENT='自定义表单表';
  223. --
  224. -- 表的结构 `__PREFIX__cms_fields`
  225. --
  226. CREATE TABLE IF NOT EXISTS `__PREFIX__cms_fields` (
  227. `id` smallint(5) UNSIGNED NOT NULL AUTO_INCREMENT,
  228. `source` varchar(30) DEFAULT '' COMMENT '来源',
  229. `source_id` int(10) NOT NULL DEFAULT '0' COMMENT '来源ID',
  230. `name` char(30) DEFAULT '' COMMENT '名称',
  231. `type` varchar(30) DEFAULT '' COMMENT '类型',
  232. `title` varchar(30) DEFAULT '' COMMENT '标题',
  233. `content` text COMMENT '内容',
  234. `defaultvalue` varchar(100) DEFAULT '' COMMENT '默认值',
  235. `rule` varchar(100) DEFAULT '' COMMENT '验证规则',
  236. `msg` varchar(100) DEFAULT '0' COMMENT '错误消息',
  237. `ok` varchar(100) DEFAULT '0' COMMENT '成功消息',
  238. `tip` varchar(100) DEFAULT '' COMMENT '提示消息',
  239. `decimals` tinyint(1) DEFAULT NULL COMMENT '小数点',
  240. `length` mediumint(8) DEFAULT NULL COMMENT '长度',
  241. `minimum` smallint(6) DEFAULT NULL COMMENT '最小数量',
  242. `maximum` smallint(6) UNSIGNED NOT NULL DEFAULT '0' COMMENT '最大数量',
  243. `extend` varchar(255) DEFAULT '' COMMENT '扩展信息',
  244. `setting` varchar(1500) DEFAULT '' COMMENT '配置信息',
  245. `weigh` int(10) NOT NULL DEFAULT '0' COMMENT '排序',
  246. `createtime` int(10) DEFAULT NULL COMMENT '添加时间',
  247. `updatetime` int(10) DEFAULT NULL COMMENT '更新时间',
  248. `isorder` tinyint(1) NOT NULL DEFAULT '0' COMMENT '是否可排序',
  249. `iscontribute` tinyint(1) NOT NULL DEFAULT '0' COMMENT '是否可投稿',
  250. `isfilter` tinyint(1) NOT NULL DEFAULT '0' COMMENT '筛选',
  251. `status` enum('normal','hidden') NOT NULL COMMENT '状态',
  252. PRIMARY KEY (`id`),
  253. KEY `source` (`source`) USING BTREE,
  254. KEY `source_id` (`source_id`)
  255. ) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4 COMMENT='模型字段表';
  256. --
  257. -- 表的结构 `__PREFIX__cms_message`
  258. --
  259. CREATE TABLE IF NOT EXISTS `__PREFIX__cms_message` (
  260. `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  261. `user_id` int(10) DEFAULT NULL COMMENT '会员ID',
  262. `name` varchar(50) DEFAULT '' COMMENT '姓名',
  263. `telephone` varchar(100) DEFAULT '' COMMENT '电话',
  264. `qq` varchar(30) DEFAULT '' COMMENT 'QQ',
  265. `content` longtext COMMENT '内容',
  266. `os` enum('windows','mac') DEFAULT 'windows' COMMENT '操作系统',
  267. `language` set('zh-cn','en') DEFAULT '' COMMENT '语言',
  268. `address` varchar(255) DEFAULT '' COMMENT '地区',
  269. `category` varchar(255) DEFAULT '' COMMENT '分类',
  270. `memo` varchar(255) DEFAULT '' COMMENT '备注',
  271. `image` varchar(500) DEFAULT '' COMMENT '图片',
  272. `createtime` int(10) DEFAULT NULL COMMENT '添加时间',
  273. `updatetime` int(10) DEFAULT NULL COMMENT '更新时间',
  274. `status` enum('normal','hidden','rejected') DEFAULT 'normal' COMMENT '状态',
  275. PRIMARY KEY (`id`),
  276. KEY `user_id` (`user_id`)
  277. ) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4 COMMENT='站内留言';
  278. --
  279. -- 表的结构 `__PREFIX__cms_model`
  280. --
  281. CREATE TABLE IF NOT EXISTS `__PREFIX__cms_model` (
  282. `id` smallint(5) UNSIGNED NOT NULL AUTO_INCREMENT,
  283. `name` char(30) DEFAULT '' COMMENT '模型名称',
  284. `table` char(20) DEFAULT '' COMMENT '表名',
  285. `fields` text COMMENT '字段列表',
  286. `channeltpl` varchar(30) DEFAULT '' COMMENT '栏目页模板',
  287. `listtpl` varchar(30) DEFAULT '' COMMENT '列表页模板',
  288. `showtpl` varchar(30) DEFAULT '' COMMENT '详情页模板',
  289. `createtime` int(10) DEFAULT NULL COMMENT '创建时间',
  290. `updatetime` int(10) DEFAULT NULL COMMENT '更新时间',
  291. `setting` text COMMENT '模型配置',
  292. PRIMARY KEY (`id`)
  293. ) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4 COMMENT='内容模型表';
  294. --
  295. -- 表的结构 `__PREFIX__cms_order`
  296. --
  297. CREATE TABLE `__PREFIX__cms_order` (
  298. `id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT 'ID',
  299. `orderid` varchar(50) DEFAULT '' COMMENT '订单ID',
  300. `user_id` int(10) unsigned DEFAULT '0' COMMENT '会员ID',
  301. `archives_id` int(10) unsigned DEFAULT '0' COMMENT '文档ID',
  302. `title` varchar(100) DEFAULT NULL COMMENT '订单标题',
  303. `amount` decimal(10,2) unsigned DEFAULT '0.00' COMMENT '订单金额',
  304. `payamount` decimal(10,2) unsigned DEFAULT '0.00' COMMENT '支付金额',
  305. `paytype` varchar(50) DEFAULT NULL COMMENT '支付类型',
  306. `paytime` int(10) DEFAULT NULL COMMENT '支付时间',
  307. `method` varchar(100) NULL DEFAULT '' COMMENT '支付方法',
  308. `ip` varchar(50) DEFAULT NULL COMMENT 'IP地址',
  309. `useragent` varchar(255) DEFAULT NULL COMMENT 'UserAgent',
  310. `memo` varchar(255) DEFAULT NULL COMMENT '备注',
  311. `createtime` int(10) DEFAULT NULL COMMENT '添加时间',
  312. `updatetime` int(10) DEFAULT NULL COMMENT '更新时间',
  313. `status` enum('created','paid','expired') DEFAULT 'created' COMMENT '状态',
  314. PRIMARY KEY (`id`),
  315. KEY `archives_id` (`archives_id`),
  316. KEY `orderid` (`orderid`)
  317. ) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4 COMMENT='订单表';
  318. --
  319. -- 表的结构 `__PREFIX__cms_page`
  320. --
  321. CREATE TABLE IF NOT EXISTS `__PREFIX__cms_page` (
  322. `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT 'ID',
  323. `category_id` int(10) NOT NULL DEFAULT '0' COMMENT '分类ID',
  324. `admin_id` int(10) unsigned DEFAULT '0' COMMENT '管理员ID',
  325. `type` varchar(50) DEFAULT '' COMMENT '类型',
  326. `title` varchar(50) DEFAULT '' COMMENT '标题',
  327. `seotitle` varchar(255) DEFAULT '' COMMENT 'SEO标题',
  328. `keywords` varchar(255) DEFAULT '' COMMENT '关键字',
  329. `description` varchar(255) DEFAULT '' COMMENT '描述',
  330. `flag` varchar(100) DEFAULT '' COMMENT '标志',
  331. `image` varchar(255) DEFAULT '' COMMENT '头像',
  332. `content` longtext COMMENT '内容',
  333. `icon` varchar(50) DEFAULT '' COMMENT '图标',
  334. `views` int(10) UNSIGNED NOT NULL DEFAULT '0' COMMENT '点击',
  335. `likes` int(10) UNSIGNED NOT NULL DEFAULT '0' COMMENT '点赞',
  336. `dislikes` int(10) UNSIGNED NOT NULL DEFAULT '0' COMMENT '点踩',
  337. `comments` int(10) UNSIGNED NOT NULL DEFAULT '0' COMMENT '评论',
  338. `diyname` varchar(100) DEFAULT '' COMMENT '自定义',
  339. `showtpl` varchar(50) DEFAULT '' COMMENT '视图模板',
  340. `iscomment` tinyint(1) unsigned DEFAULT '1' COMMENT '是否允许评论',
  341. `parsetpl` tinyint(1) UNSIGNED NULL DEFAULT '0' COMMENT '解析模板标签',
  342. `createtime` int(10) DEFAULT NULL COMMENT '创建时间',
  343. `updatetime` int(10) DEFAULT NULL COMMENT '更新时间',
  344. `deletetime` int(10) DEFAULT NULL COMMENT '删除时间',
  345. `weigh` int(10) NOT NULL DEFAULT '0' COMMENT '权重',
  346. `status` varchar(30) DEFAULT '' COMMENT '状态',
  347. PRIMARY KEY (`id`),
  348. KEY `diyname` (`diyname`),
  349. KEY `type` (`type`)
  350. ) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4 COMMENT='单页表';
  351. --
  352. -- 表的结构 `__PREFIX__cms_search_log`
  353. --
  354. CREATE TABLE `__PREFIX__cms_search_log` (
  355. `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  356. `keywords` varchar(100) CHARACTER SET utf8mb4 DEFAULT '' COMMENT '关键字',
  357. `nums` int(10) unsigned DEFAULT '0' COMMENT '搜索次数',
  358. PRIMARY KEY (`id`),
  359. UNIQUE KEY `keywords` (`keywords`)
  360. ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='搜索记录表';
  361. --
  362. -- 表的结构 `__PREFIX__cms_special`
  363. --
  364. CREATE TABLE `__PREFIX__cms_special` (
  365. `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  366. `admin_id` int(10) unsigned DEFAULT '0' COMMENT '管理员ID',
  367. `title` varchar(100) DEFAULT '' COMMENT '标题',
  368. `tag_ids` varchar(1500) NULL DEFAULT '' COMMENT '标签ID集合',
  369. `flag` varchar(100) DEFAULT '' COMMENT '标志',
  370. `label` varchar(50) DEFAULT '' COMMENT '标签',
  371. `image` varchar(100) DEFAULT '' COMMENT '图片',
  372. `banner` varchar(100) DEFAULT '' COMMENT 'Banner图片',
  373. `diyname` varchar(100) DEFAULT '' COMMENT '自定义名称',
  374. `seotitle` varchar(255) DEFAULT '' COMMENT 'SEO标题',
  375. `keywords` varchar(100) DEFAULT NULL COMMENT '关键字',
  376. `description` varchar(255) DEFAULT NULL COMMENT '描述',
  377. `intro` varchar(255) DEFAULT NULL COMMENT '专题介绍',
  378. `views` int(10) unsigned DEFAULT '0' COMMENT '浏览次数',
  379. `comments` int(10) unsigned DEFAULT '0' COMMENT '评论次数',
  380. `iscomment` tinyint(1) unsigned DEFAULT '1' COMMENT '是否允许评论',
  381. `createtime` int(10) DEFAULT NULL COMMENT '添加时间',
  382. `updatetime` int(10) DEFAULT NULL COMMENT '更新时间',
  383. `deletetime` int(10) DEFAULT NULL COMMENT '删除时间',
  384. `template` varchar(100) DEFAULT '' COMMENT '专题模板',
  385. `status` enum('normal','hidden') NOT NULL DEFAULT 'normal' COMMENT '状态',
  386. PRIMARY KEY (`id`),
  387. KEY `diyname` (`diyname`)
  388. ) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4 COMMENT='专题表';
  389. --
  390. -- 表的结构 `__PREFIX__cms_tag`
  391. --
  392. CREATE TABLE IF NOT EXISTS `__PREFIX__cms_tag` (
  393. `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT,
  394. `name` varchar(50) DEFAULT '' COMMENT '标签名称',
  395. `nums` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '文档数量',
  396. `seotitle` varchar(100) DEFAULT '' COMMENT 'SEO标题',
  397. `keywords` varchar(255) DEFAULT NULL COMMENT '关键字',
  398. `description` varchar(255) DEFAULT NULL COMMENT '描述',
  399. `views` int(10) DEFAULT NULL COMMENT '浏览次数',
  400. `autolink` tinyint(1) unsigned DEFAULT 0 COMMENT '自动内链',
  401. `createtime` int(10) DEFAULT NULL COMMENT '添加时间',
  402. `updatetime` int(10) DEFAULT NULL COMMENT '更新时间',
  403. `status` enum('normal','hidden') DEFAULT 'normal' COMMENT '状态',
  404. PRIMARY KEY (`id`),
  405. UNIQUE KEY `name` (`name`) USING BTREE,
  406. KEY `nums` (`nums`)
  407. ) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4 COMMENT='标签表';
  408. --
  409. -- 表的结构 `__PREFIX__cms_taggable`
  410. --
  411. CREATE TABLE IF NOT EXISTS `__PREFIX__cms_taggable` (
  412. `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  413. `tag_id` int(10) DEFAULT NULL COMMENT '标签ID',
  414. `archives_id` int(10) DEFAULT NULL COMMENT '文档ID',
  415. `createtime` int(10) DEFAULT NULL COMMENT '添加时间',
  416. PRIMARY KEY (`id`),
  417. KEY `tag_id` (`tag_id`),
  418. KEY `archives_id` (`archives_id`)
  419. ) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4 COMMENT='标签列表';
  420. -- 1.3.5 --
  421. ALTER TABLE `__PREFIX__cms_tag` ADD COLUMN `autolink` tinyint(1) unsigned DEFAULT 0 COMMENT '自动内链' AFTER `views`;
  422. -- 1.3.6 --
  423. ALTER TABLE `__PREFIX__cms_order` ADD COLUMN `method` varchar(100) NULL DEFAULT '' COMMENT '支付方法' AFTER `paytime`;
  424. ALTER TABLE `__PREFIX__cms_page` ADD COLUMN `parsetpl` tinyint(1) UNSIGNED NULL DEFAULT 0 COMMENT '解析模板标签' AFTER `iscomment`;
  425. ALTER TABLE `__PREFIX__cms_block` ADD COLUMN `parsetpl` tinyint(1) UNSIGNED NULL DEFAULT 0 COMMENT '解析模板标签' AFTER `content`;
  426. -- 1.3.7 --
  427. ALTER TABLE `__PREFIX__cms_channel` ADD COLUMN `vip` tinyint(1) UNSIGNED NULL DEFAULT 0 COMMENT 'VIP' AFTER `pagesize`;
  428. ALTER TABLE `__PREFIX__cms_channel` ADD COLUMN `listtype` tinyint(1) unsigned DEFAULT '0' COMMENT '列表数据类型' AFTER `vip`;
  429. -- 1.4.0 --
  430. ALTER TABLE `__PREFIX__cms_archives` ADD COLUMN `price` decimal(10, 2) UNSIGNED NULL DEFAULT 0 COMMENT '价格' AFTER `description`,ADD COLUMN `outlink` varchar(255) NULL DEFAULT '' COMMENT '外部链接' AFTER `price`;
  431. ALTER TABLE `__PREFIX__cms_diyform` ADD COLUMN `iscaptcha` tinyint(1) UNSIGNED NULL DEFAULT 0 COMMENT '是否启用验证码' AFTER `isedit`;
  432. ALTER TABLE `__PREFIX__cms_archives` ADD INDEX(`channel_id`), ADD INDEX(`channel_ids`), ADD INDEX(`diyname`);
  433. ALTER TABLE `__PREFIX__cms_channel` ADD INDEX(`type`);
  434. ALTER TABLE `__PREFIX__cms_page` ADD INDEX(`diyname`);
  435. ALTER TABLE `__PREFIX__cms_special` ADD INDEX(`diyname`);
  436. ALTER TABLE `__PREFIX__cms_order` ADD INDEX(`orderid`);
  437. ALTER TABLE `__PREFIX__cms_fields` ADD COLUMN `filterlist` text NULL COMMENT '筛选列表' AFTER `content`;
  438. -- 1.4.3 --
  439. ALTER TABLE `__PREFIX__cms_collection` DROP INDEX `aid`,ADD UNIQUE INDEX `aid`(`type`, `aid`, `user_id`) USING BTREE;