From edf7df368e6abf72c3a3ad18c8a602ce4e228bf7 Mon Sep 17 00:00:00 2001 From: skiffer-git <44203734@qq.com> Date: Sat, 16 Apr 2022 20:30:02 +0800 Subject: [PATCH] organization --- pkg/common/db/mysql.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkg/common/db/mysql.go b/pkg/common/db/mysql.go index 925058841..cfef4dfee 100644 --- a/pkg/common/db/mysql.go +++ b/pkg/common/db/mysql.go @@ -107,15 +107,15 @@ func initMysqlDB() { db.CreateTable(&Conversation{}) } - if db.HasTable(&Department{}) { + if !db.HasTable(&Department{}) { fmt.Println("CreateTable Department") db.CreateTable(&Department{}) } - if db.HasTable(&OrganizationUser{}) { + if !db.HasTable(&OrganizationUser{}) { fmt.Println("CreateTable OrganizationUser") db.CreateTable(&OrganizationUser{}) } - if db.HasTable(&DepartmentMember{}) { + if !db.HasTable(&DepartmentMember{}) { fmt.Println("CreateTable DepartmentMember") db.CreateTable(&DepartmentMember{}) }