- 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
92 lines
1.5 KiB
SQL
92 lines
1.5 KiB
SQL
-- Add moderation_flags collection to Directus
|
|
INSERT INTO directus_collections (
|
|
collection,
|
|
icon,
|
|
note,
|
|
display_template,
|
|
hidden,
|
|
singleton,
|
|
translations,
|
|
archive_field,
|
|
archive_app_filter,
|
|
archive_value,
|
|
unarchive_value,
|
|
sort_field,
|
|
accountability,
|
|
color,
|
|
item_duplication_fields,
|
|
sort,
|
|
"group",
|
|
collapse,
|
|
preview_url,
|
|
versioning
|
|
) VALUES (
|
|
'moderation_flags',
|
|
'flag',
|
|
'AI-powered content moderation flags',
|
|
null,
|
|
false,
|
|
false,
|
|
null,
|
|
null,
|
|
false,
|
|
'archived',
|
|
null,
|
|
null,
|
|
'all',
|
|
null,
|
|
'#FF6B6B',
|
|
null,
|
|
null,
|
|
null,
|
|
null,
|
|
null,
|
|
false
|
|
) ON CONFLICT (collection) DO NOTHING;
|
|
|
|
-- Add user_status_history collection to Directus
|
|
INSERT INTO directus_collections (
|
|
collection,
|
|
icon,
|
|
note,
|
|
display_template,
|
|
hidden,
|
|
singleton,
|
|
translations,
|
|
archive_field,
|
|
archive_app_filter,
|
|
archive_value,
|
|
unarchive_value,
|
|
sort_field,
|
|
accountability,
|
|
color,
|
|
item_duplication_fields,
|
|
sort,
|
|
"group",
|
|
collapse,
|
|
preview_url,
|
|
versioning
|
|
) VALUES (
|
|
'user_status_history',
|
|
'history',
|
|
'User status change history for audit trail',
|
|
null,
|
|
false,
|
|
false,
|
|
null,
|
|
null,
|
|
false,
|
|
'archived',
|
|
null,
|
|
null,
|
|
'all',
|
|
null,
|
|
'#4ECDC4',
|
|
null,
|
|
null,
|
|
null,
|
|
null,
|
|
null,
|
|
false
|
|
) ON CONFLICT (collection) DO NOTHING;
|