Update New Features

This commit is contained in:
Koncept Kit
2025-12-10 17:52:32 +07:00
parent 005c56b43d
commit f051976881
20 changed files with 2776 additions and 57 deletions

View File

@@ -0,0 +1,38 @@
-- Migration: Add calendar_uid to events table and remove Microsoft Calendar columns
-- Sprint 2: Universal Calendar Export
-- Add new calendar_uid column
ALTER TABLE events ADD COLUMN IF NOT EXISTS calendar_uid VARCHAR;
-- Remove old Microsoft Calendar columns (if they exist)
ALTER TABLE events DROP COLUMN IF EXISTS microsoft_calendar_id;
ALTER TABLE events DROP COLUMN IF EXISTS microsoft_calendar_sync_enabled;
-- Verify migration
DO $$
BEGIN
-- Check if calendar_uid exists
IF EXISTS (
SELECT 1 FROM information_schema.columns
WHERE table_name = 'events' AND column_name = 'calendar_uid'
) THEN
RAISE NOTICE '✅ calendar_uid column added successfully';
ELSE
RAISE NOTICE '⚠️ calendar_uid column not found';
END IF;
-- Check if old columns are removed
IF NOT EXISTS (
SELECT 1 FROM information_schema.columns
WHERE table_name = 'events' AND column_name = 'microsoft_calendar_id'
) THEN
RAISE NOTICE '✅ microsoft_calendar_id column removed';
END IF;
IF NOT EXISTS (
SELECT 1 FROM information_schema.columns
WHERE table_name = 'events' AND column_name = 'microsoft_calendar_sync_enabled'
) THEN
RAISE NOTICE '✅ microsoft_calendar_sync_enabled column removed';
END IF;
END $$;