second commit

This commit is contained in:
Rogee
2026-06-04 15:44:48 +08:00
parent 4db6efb3a7
commit 8ac150bc7b
1275 changed files with 286124 additions and 0 deletions
@@ -0,0 +1,17 @@
-- Update platform_apps: add new columns, drop api_key columns (replaced by AccessToken table)
-- Reference: Chatwoot platform_apps evolution
-- Add new columns
ALTER TABLE platform_apps ADD COLUMN IF NOT EXISTS icon VARCHAR(255);
ALTER TABLE platform_apps ADD COLUMN IF NOT EXISTS url VARCHAR(512);
ALTER TABLE platform_apps ADD COLUMN IF NOT EXISTS config JSONB DEFAULT '{}';
ALTER TABLE platform_apps ADD COLUMN IF NOT EXISTS active BOOLEAN DEFAULT TRUE;
-- Note: type column already exists in platform_apps (VARCHAR(50) DEFAULT 'api'), so no change needed.
-- Drop old api_key columns (replaced by access_tokens table)
-- First drop the unique index on api_key
DROP INDEX IF EXISTS idx_platform_apps_api_key;
-- Then drop the columns
ALTER TABLE platform_apps DROP COLUMN IF EXISTS api_key;
ALTER TABLE platform_apps DROP COLUMN IF EXISTS api_key_prefix;