[feat]网关子设备,直接上传,自动创建设备模型,无需手动创建

This commit is contained in:
PandaX
2023-10-17 11:14:18 +08:00
parent f26c5a2647
commit 55e399e5cb
23 changed files with 1457 additions and 74 deletions

View File

@@ -45,7 +45,7 @@ func (s *TdEngine) CreateStable(table string) (err error) {
// CreateTable 添加子表
func (s *TdEngine) CreateTable(stable, table string) (err error) {
sql := fmt.Sprintf("CREATE TABLE %s USING %s TAGS ('%s')", table, stable, table)
sql := fmt.Sprintf("CREATE TABLE IF NOT EXISTS %s USING %s TAGS ('%s')", table, stable, table)
_, err = s.db.Exec(sql)
return
}