gate2: fix mail plugin migration 0009 — guard UPDATE for missing deleted_at column on fresh DB
Check Cross-Plugin Imports / check (push) Has been cancelled
Check Cross-Plugin Imports / check (push) Has been cancelled
This commit is contained in:
@@ -1,4 +1,15 @@
|
||||
-- Remove soft-delete (deleted_at) logic from mails
|
||||
-- Mails now use standard mail program logic: folder_id for Trash, permanent DELETE for Trash empty
|
||||
-- This migration clears all existing deleted_at values so no mails are hidden
|
||||
UPDATE mails SET deleted_at = NULL;
|
||||
-- Safe for fresh installs: only update if column exists
|
||||
DO $$
|
||||
BEGIN
|
||||
IF EXISTS (
|
||||
SELECT 1 FROM information_schema.columns
|
||||
WHERE table_schema = 'public'
|
||||
AND table_name = 'mails'
|
||||
AND column_name = 'deleted_at'
|
||||
) THEN
|
||||
UPDATE mails SET deleted_at = NULL;
|
||||
END IF;
|
||||
END $$;
|
||||
|
||||
Reference in New Issue
Block a user