RBAC, Permissions, and Export/Import

This commit is contained in:
Koncept Kit
2025-12-16 20:03:50 +07:00
parent b268c3fff8
commit ed5526e27b
27 changed files with 10284 additions and 73 deletions

View File

@@ -0,0 +1,39 @@
-- Migration: Add Reminder Tracking Fields to User Model
--
-- This migration adds fields to track reminder emails sent to users,
-- allowing admins to see how many reminders each user has received
-- and when the last reminder was sent.
--
-- This is especially helpful for older members who may need personal outreach.
-- Add email verification reminder tracking
ALTER TABLE users
ADD COLUMN email_verification_reminders_sent INTEGER DEFAULT 0 NOT NULL;
ALTER TABLE users
ADD COLUMN last_email_verification_reminder_at TIMESTAMP WITH TIME ZONE;
-- Add event attendance reminder tracking
ALTER TABLE users
ADD COLUMN event_attendance_reminders_sent INTEGER DEFAULT 0 NOT NULL;
ALTER TABLE users
ADD COLUMN last_event_attendance_reminder_at TIMESTAMP WITH TIME ZONE;
-- Add payment reminder tracking
ALTER TABLE users
ADD COLUMN payment_reminders_sent INTEGER DEFAULT 0 NOT NULL;
ALTER TABLE users
ADD COLUMN last_payment_reminder_at TIMESTAMP WITH TIME ZONE;
-- Add renewal reminder tracking
ALTER TABLE users
ADD COLUMN renewal_reminders_sent INTEGER DEFAULT 0 NOT NULL;
ALTER TABLE users
ADD COLUMN last_renewal_reminder_at TIMESTAMP WITH TIME ZONE;
-- Success message
SELECT 'Migration completed: Reminder tracking fields added to users table' AS result;
SELECT 'Admins can now track reminder counts in the dashboard' AS note;