ALTER TABLE `pre_goods`
ADD COLUMN `limit_once` tinyint(1) NOT NULL DEFAULT '0' COMMENT '限购一次 0否 1是' AFTER `desc`;

ALTER TABLE `pre_loginconfig`
ADD COLUMN `biz` varchar(16) NOT NULL DEFAULT 'cloud' COMMENT '业务 cloud/dg' AFTER `cids`;

ALTER TABLE `pre_loginconfig`
ADD COLUMN `query_api` varchar(255) DEFAULT NULL COMMENT '查询/代挂API根地址' AFTER `url`;

ALTER TABLE `pre_login_class`
ADD COLUMN `biz` varchar(16) NOT NULL DEFAULT 'cloud' COMMENT '业务 cloud/dg' AFTER `cid`;

DROP TABLE IF EXISTS `pre_dg_qq`;
CREATE TABLE `pre_dg_qq` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `zid` int(11) DEFAULT NULL COMMENT '所属用户',
  `qq` varchar(15) DEFAULT NULL,
  `pwd` varchar(30) DEFAULT NULL,
  `cityid` int(11) NOT NULL DEFAULT 0 COMMENT '登录接口ID',
  `online` tinyint(1) NOT NULL DEFAULT 0 COMMENT '0自动上线',
  `dropline` tinyint(1) NOT NULL DEFAULT 0 COMMENT '0否，1掉线重登',
  `protocol` varchar(30) DEFAULT NULL COMMENT '登陆协议',
  `login_zt` tinyint(1) NOT NULL DEFAULT '0' COMMENT '登陆状态1在线',
  `login_cuont` int(11) NOT NULL DEFAULT '0' COMMENT '登录次数',
  `uptime` datetime NULL,
  `addtime` datetime NULL,
  `endtime_arr` text DEFAULT NULL COMMENT '各分类到期时间JSON',
  `dropline_time` int(11) NOT NULL DEFAULT '0',
  `out_notify` text DEFAULT NULL COMMENT '掉线通知',
  PRIMARY KEY (`id`),
  UNIQUE (`qq`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1000;

INSERT IGNORE INTO `pre_config` (`k`,`v`) VALUES ('dg_open', '0');
INSERT IGNORE INTO `pre_config` (`k`,`v`) VALUES ('version_name_dg', '代挂版');
