feat: add cmpp inbound gateway listener
This commit is contained in:
@@ -0,0 +1,13 @@
|
||||
ALTER TABLE "SmsApplication" ADD COLUMN "cmppAccount" TEXT;
|
||||
|
||||
WITH numbered AS (
|
||||
SELECT id, row_number() OVER (ORDER BY "createdAt", id) AS rn
|
||||
FROM "SmsApplication"
|
||||
)
|
||||
UPDATE "SmsApplication" app
|
||||
SET "cmppAccount" = lpad(((100000 + numbered.rn) % 1000000)::text, 6, '0')
|
||||
FROM numbered
|
||||
WHERE app.id = numbered.id;
|
||||
|
||||
ALTER TABLE "SmsApplication" ALTER COLUMN "cmppAccount" SET NOT NULL;
|
||||
CREATE UNIQUE INDEX "SmsApplication_cmppAccount_key" ON "SmsApplication"("cmppAccount");
|
||||
@@ -336,6 +336,7 @@ model SmsApplication {
|
||||
name String
|
||||
scene String?
|
||||
callbackUrl String?
|
||||
cmppAccount String @unique
|
||||
secretHash String
|
||||
dailyLimit Int?
|
||||
customerUnitPrice Int @default(0)
|
||||
|
||||
Reference in New Issue
Block a user