- Create organized migration folder structure: - database/ - Core schema changes and migrations - tests/ - Test scripts and verification queries - directus/ - Directus CMS configuration scripts - fixes/ - Database fixes and patches - archive/ - Historical and deprecated scripts - Move 60+ SQL files from root to appropriate folders - Add comprehensive README with usage guidelines - Consolidate old migrations_archive into new archive folder - Maintain clear separation of concerns for different script types Benefits: - Cleaner project root directory - Easier to find specific types of SQL scripts - Better organization for maintenance and development - Clear documentation for migration procedures - Proper separation of production vs development scripts
11 lines
378 B
SQL
11 lines
378 B
SQL
SELECT flag_reason,
|
|
CASE
|
|
WHEN post_id IS NOT NULL AND comment_id IS NULL THEN 'Post'
|
|
WHEN comment_id IS NOT NULL AND post_id IS NULL THEN 'Comment'
|
|
ELSE 'Unknown'
|
|
END as content_type,
|
|
status
|
|
FROM moderation_flags
|
|
WHERE flag_reason IN ('test_text', 'test_image', 'test_video', 'test_comment')
|
|
ORDER BY created_at DESC;
|