fix: correct application cmpp credentials

This commit is contained in:
hectorzhao
2026-07-09 17:18:39 +08:00
parent 57a4c86a79
commit 767f0ca9aa
13 changed files with 149 additions and 24 deletions
@@ -0,0 +1,9 @@
ALTER TABLE "SmsApplication" ADD COLUMN "cmppEnterpriseCode" TEXT;
UPDATE "SmsApplication" AS app
SET "cmppEnterpriseCode" = tenant."code",
"secretHash" = substring(md5(random()::text || clock_timestamp()::text || app."id") from 1 for 16)
FROM "Tenant" AS tenant
WHERE app."tenantId" = tenant."id";
ALTER TABLE "SmsApplication" ALTER COLUMN "cmppEnterpriseCode" SET NOT NULL;