feat: initialize tenant workbench in shared database

This commit is contained in:
richjohnrambo
2026-09-23 17:04:01 +08:00
parent c8413f82d9
commit 86c5486cc4
11 changed files with 187 additions and 92 deletions
+26
View File
@@ -0,0 +1,26 @@
package config
import (
"strings"
"testing"
)
func TestValidateRejectsDeprecatedTinodeDatabase(t *testing.T) {
cfg := defaultConfig()
cfg.MySQL.DSN = "root:root@tcp(127.0.0.1:3306)/tinode?parseTime=true"
err := cfg.validate()
if err == nil || !strings.Contains(err.Error(), "tinode is deprecated") {
t.Fatalf("validate() error = %v, want deprecated database error", err)
}
}
func TestDefaultConfigUsesMeetingIMDatabase(t *testing.T) {
cfg := defaultConfig()
if err := cfg.validate(); err != nil {
t.Fatalf("default config validation failed: %v", err)
}
if !strings.Contains(cfg.MySQL.DSN, "/meeting_im?") {
t.Fatalf("default mysql dsn = %q, want meeting_im database", cfg.MySQL.DSN)
}
}