Skip to content

Commit e5989f3

Browse files
Merge pull request #1433 from paulocoutinhox/fix-mysql-wavoip-token
fix mysql wavoip token
2 parents bff3bf5 + 90e27cc commit e5989f3

File tree

1 file changed

+26
-0
lines changed
  • prisma/mysql-migrations/20250510035200_add_wavoip_token_to_settings_table

1 file changed

+26
-0
lines changed
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
/*
2+
Warnings:
3+
4+
- A unique constraint covering the columns `[remoteJid,instanceId]` on the table `Chat` will be added. If there are existing duplicate values, this will fail.
5+
6+
*/
7+
8+
-- AlterTable
9+
SET @column_exists := (
10+
SELECT COUNT(*)
11+
FROM information_schema.columns
12+
WHERE table_schema = DATABASE()
13+
AND table_name = 'Setting'
14+
AND column_name = 'wavoipToken'
15+
);
16+
17+
SET @sql := IF(@column_exists = 0,
18+
'ALTER TABLE Setting ADD COLUMN wavoipToken VARCHAR(100);',
19+
'SELECT "Column already exists";'
20+
);
21+
22+
PREPARE stmt FROM @sql;
23+
EXECUTE stmt;
24+
DEALLOCATE PREPARE stmt;
25+
26+
ALTER TABLE Chat ADD CONSTRAINT unique_remote_instance UNIQUE (remoteJid, instanceId);

0 commit comments

Comments
 (0)