things db config and sdk

This commit is contained in:
imhao183
2020-05-01 12:38:27 +08:00
committed by heavyrain2012
parent 739452830d
commit e771794bc0
17 changed files with 355 additions and 14 deletions
+15
View File
@@ -0,0 +1,15 @@
DROP TABLE IF EXISTS `t_thing`;
DROP TABLE IF EXISTS `t_device`;
CREATE TABLE `t_device` (
`id` int(11) NOT NULL PRIMARY KEY AUTO_INCREMENT,
`_uid` varchar(64) NOT NULL,
`_owner` varchar(64) DEFAULT '',
`_token` varchar(64) DEFAULT '',
`_state` tinyint DEFAULT 0,
`_extra` TEXT DEFAULT NULL,
`_dt` bigint(20) NOT NULL,
UNIQUE INDEX `device_uid_index` (`_uid` ASC),
INDEX `device_owner_index` (`_owner` ASC)
)
+1
View File
@@ -0,0 +1 @@
alter table t_user_session add column `_user_type` tinyint DEFAULT 0;
+19
View File
@@ -0,0 +1,19 @@
DROP TABLE IF EXISTS `t_thing`;
DROP TABLE IF EXISTS `t_device`;
CREATE TABLE `t_device` (
`id` int(11) NOT NULL PRIMARY KEY AUTO_INCREMENT,
`_uid` varchar(64) NOT NULL,
`_owner` varchar(64) DEFAULT '',
`_token` varchar(64) DEFAULT '',
`_state` tinyint DEFAULT 0,
`_extra` TEXT DEFAULT NULL,
`_dt` bigint(20) NOT NULL,
UNIQUE INDEX `device_uid_index` (`_uid` ASC),
INDEX `device_owner_index` (`_owner` ASC)
)
ENGINE = InnoDB
DEFAULT CHARACTER SET = utf8mb4
COLLATE = utf8mb4_unicode_ci;
+1
View File
@@ -0,0 +1 @@
alter table t_user_session add column `_user_type` tinyint DEFAULT 0 COMMENT "0, normal user; 1, robot; 2, device;";