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,20 @@
-- Migration: Add member_since field to users table
--
-- This field allows admins to manually set historical membership dates
-- for users imported from the old WordPress site.
--
-- For new users, it can be left NULL and will default to created_at when displayed.
-- For imported users, admins can set it to the actual date they became a member.
-- Add member_since column (nullable timestamp with timezone)
ALTER TABLE users
ADD COLUMN member_since TIMESTAMP WITH TIME ZONE;
-- Backfill existing active members: use created_at as default
-- This is reasonable since they became members when they created their account
UPDATE users
SET member_since = created_at
WHERE status = 'active' AND member_since IS NULL;
-- Success message
SELECT 'Migration completed: member_since field added to users table' AS result;