========================================= STRUCTURE COMPLÈTE BASE DE DONNÉES FAILDAILY ========================================= Date: Mon Nov 25 21:55:00 UTC 2025 ARCHITECTURE: 2 BASES DE DONNÉES SÉPARÉES - Base principale: faildaily (37 tables) - Base logs: faildaily_logs (6 tables) ========================================= BASE: faildaily (APPLICATION) ========================================= ========================================= TABLE: activity_logs ========================================= Field Type Null Key Default Extra id char(36) NO PRI NULL event_type varchar(100) NO MUL NULL event_category varchar(50) YES NULL action varchar(100) YES NULL title varchar(255) YES NULL description text YES NULL message text NO NULL user_id char(36) YES MUL NULL target_user_id char(36) YES NULL user_email varchar(255) YES NULL user_display_name varchar(255) YES NULL user_role varchar(50) YES NULL resource_type varchar(100) YES NULL resource_id char(36) YES NULL payload longtext YES NULL details longtext YES NULL old_values longtext YES NULL new_values longtext YES NULL ip_address varchar(45) YES NULL user_agent text YES NULL session_id varchar(255) YES NULL correlation_id char(36) YES NULL success tinyint(1) YES MUL 1 error_code varchar(50) YES NULL error_message text YES NULL created_at timestamp YES MUL CURRENT_TIMESTAMP DEFAULT_GENERATED Indexes: activity_logs 0 PRIMARY 1 id A 0 NULL NULL BTREE YES NULL activity_logs 1 idx_activity_user_id 1 user_id A 0 NULL NULL YES BTREE YES NULL activity_logs 1 idx_activity_created_at 1 created_at A 0 NULL NULL YES BTREE YES NULL activity_logs 1 idx_activity_logs_event_type 1 event_type A 0 NULL NULL BTREE YES NULL activity_logs 1 idx_activity_logs_success 1 success A 0 NULL NULL YES BTREE YES NULL Count: total 0 ========================================= TABLE: app_config ========================================= Field Type Null Key Default Extra id char(36) NO PRI NULL key varchar(255) NO UNI NULL value longtext NO NULL description text YES NULL created_at timestamp YES CURRENT_TIMESTAMP DEFAULT_GENERATED updated_at timestamp YES CURRENT_TIMESTAMP DEFAULT_GENERATED on update CURRENT_TIMESTAMP Indexes: app_config 0 PRIMARY 1 id A 3 NULL NULL BTREE YES NULL app_config 0 unique_config_key 1 key A 3 NULL NULL BTREE YES NULL Count: total 3 ========================================= TABLE: badge_definitions ========================================= Field Type Null Key Default Extra id varchar(100) NO PRI NULL name varchar(255) NO NULL description text NO NULL icon varchar(100) NO NULL category varchar(50) NO MUL NULL rarity varchar(50) NO MUL NULL requirement_type varchar(50) NO NULL requirement_value int NO 1 created_at timestamp NO CURRENT_TIMESTAMP DEFAULT_GENERATED Indexes: badge_definitions 0 PRIMARY 1 id A 65 NULL NULL BTREE YES NULL badge_definitions 1 idx_badge_definitions_category 1 category A 6 NULL NULL BTREE YES NULL badge_definitions 1 idx_badge_definitions_rarity 1 rarity A 4 NULL NULL BTREE YES NULL Count: total 65 ========================================= TABLE: comment_moderation ========================================= Field Type Null Key Default Extra comment_id char(36) NO PRI NULL status enum('under_review','hidden','approved','rejected') NO under_review updated_at timestamp YES CURRENT_TIMESTAMP DEFAULT_GENERATED on update CURRENT_TIMESTAMP created_at timestamp YES CURRENT_TIMESTAMP DEFAULT_GENERATED Indexes: comment_moderation 0 PRIMARY 1 comment_id A 0 NULL NULL BTREE YES NULL Count: total 0 ========================================= TABLE: comment_reactions ========================================= Field Type Null Key Default Extra id char(36) NO PRI NULL comment_id char(36) NO MUL NULL user_id char(36) NO MUL NULL type varchar(50) NO like created_at timestamp YES CURRENT_TIMESTAMP DEFAULT_GENERATED Indexes: comment_reactions 0 PRIMARY 1 id A 0 NULL NULL BTREE YES NULL comment_reactions 0 uniq_comment_user 1 comment_id A 0 NULL NULL BTREE YES NULL comment_reactions 0 uniq_comment_user 2 user_id A 0 NULL NULL BTREE YES NULL comment_reactions 1 idx_comment 1 comment_id A 0 NULL NULL BTREE YES NULL comment_reactions 1 idx_user 1 user_id A 0 NULL NULL BTREE YES NULL Count: total 0 ========================================= TABLE: comment_reports ========================================= Field Type Null Key Default Extra id char(36) NO PRI NULL comment_id char(36) NO MUL NULL user_id char(36) NO MUL NULL reason text YES NULL created_at timestamp YES CURRENT_TIMESTAMP DEFAULT_GENERATED Indexes: comment_reports 0 PRIMARY 1 id A 0 NULL NULL BTREE YES NULL comment_reports 0 uniq_report_comment_user 1 comment_id A 0 NULL NULL BTREE YES NULL comment_reports 0 uniq_report_comment_user 2 user_id A 0 NULL NULL BTREE YES NULL comment_reports 1 idx_comment 1 comment_id A 0 NULL NULL BTREE YES NULL comment_reports 1 idx_user 1 user_id A 0 NULL NULL BTREE YES NULL Count: total 0 ========================================= TABLE: comments ========================================= Field Type Null Key Default Extra id char(36) NO PRI NULL fail_id char(36) NO MUL NULL user_id char(36) NO MUL NULL content text NO NULL is_encouragement tinyint(1) YES 1 created_at timestamp YES CURRENT_TIMESTAMP DEFAULT_GENERATED updated_at timestamp YES CURRENT_TIMESTAMP DEFAULT_GENERATED on update CURRENT_TIMESTAMP Indexes: comments 0 PRIMARY 1 id A 12 NULL NULL BTREE YES NULL comments 1 idx_comments_fail_id 1 fail_id A 9 NULL NULL BTREE YES NULL comments 1 comments_user_id_fkey 1 user_id A 2 NULL NULL BTREE YES NULL comments 1 idx_comments_fail_created 1 fail_id A 9 NULL NULL BTREE YES NULL comments 1 idx_comments_fail_created 2 created_at A 12 NULL NULL YES BTREE YES NULL comments 1 idx_comments_user_created 1 user_id A 2 NULL NULL BTREE YES NULL comments 1 idx_comments_user_created 2 created_at A 12 NULL NULL YES BTREE YES NULL Count: total 14 ========================================= TABLE: email_verification_tokens ========================================= Field Type Null Key Default Extra id char(36) NO PRI NULL user_id char(36) NO MUL NULL token varchar(255) NO UNI NULL expires_at timestamp NO NULL created_at timestamp YES CURRENT_TIMESTAMP DEFAULT_GENERATED verified_at timestamp YES NULL Indexes: email_verification_tokens 0 PRIMARY 1 id A 12 NULL NULL BTREE YES NULL email_verification_tokens 0 uniq_email_token 1 token A 12 NULL NULL BTREE YES NULL email_verification_tokens 1 idx_evt_user 1 user_id A 12 NULL NULL BTREE YES NULL Count: total 13 ========================================= TABLE: error_logs ========================================= Field Type Null Key Default Extra id varchar(16) NO PRI NULL type varchar(100) NO MUL NULL message text YES NULL stack text YES NULL url varchar(500) YES NULL method varchar(10) YES NULL user_id char(36) YES MUL NULL details json YES NULL created_at timestamp YES MUL CURRENT_TIMESTAMP DEFAULT_GENERATED Indexes: error_logs 0 PRIMARY 1 id A 0 NULL NULL BTREE YES NULL error_logs 1 idx_created 1 created_at A 0 NULL NULL YES BTREE YES NULL error_logs 1 idx_type 1 type A 0 NULL NULL BTREE YES NULL error_logs 1 idx_user 1 user_id A 0 NULL NULL YES BTREE YES NULL Count: total 0 ========================================= TABLE: fail_moderation ========================================= Field Type Null Key Default Extra fail_id char(36) NO PRI NULL status enum('under_review','hidden','approved','rejected') NO MUL under_review updated_at timestamp YES MUL CURRENT_TIMESTAMP DEFAULT_GENERATED on update CURRENT_TIMESTAMP created_at timestamp YES CURRENT_TIMESTAMP DEFAULT_GENERATED Indexes: fail_moderation 0 PRIMARY 1 fail_id A 2 NULL NULL BTREE YES NULL fail_moderation 1 idx_fail_moderation_status 1 status A 1 NULL NULL BTREE YES NULL fail_moderation 1 idx_fail_moderation_updated 1 updated_at A 2 NULL NULL YES BTREE YES NULL Count: total 2 ========================================= TABLE: fail_reactions_archive ========================================= Field Type Null Key Default Extra fail_id char(36) NO PRI NULL reactions_json longtext YES NULL archived_at timestamp YES MUL CURRENT_TIMESTAMP DEFAULT_GENERATED Indexes: fail_reactions_archive 0 PRIMARY 1 fail_id A 0 NULL NULL BTREE YES NULL fail_reactions_archive 1 idx_archived_at 1 archived_at A 0 NULL NULL YES BTREE YES NULL Count: total 0 ========================================= TABLE: fail_reports ========================================= Field Type Null Key Default Extra id char(36) NO PRI NULL fail_id char(36) NO MUL NULL user_id char(36) NO MUL NULL reason text YES NULL created_at timestamp YES CURRENT_TIMESTAMP DEFAULT_GENERATED Indexes: fail_reports 0 PRIMARY 1 id A 2 NULL NULL BTREE YES NULL fail_reports 0 uniq_fail_report 1 fail_id A 1 NULL NULL BTREE YES NULL fail_reports 0 uniq_fail_report 2 user_id A 2 NULL NULL BTREE YES NULL fail_reports 1 idx_fail_reports_fail 1 fail_id A 1 NULL NULL BTREE YES NULL fail_reports 1 idx_fail_reports_user 1 user_id A 2 NULL NULL BTREE YES NULL Count: total 3 ========================================= TABLE: fails ========================================= Field Type Null Key Default Extra id char(36) NO PRI NULL user_id char(36) NO MUL NULL title varchar(255) NO NULL description text NO NULL category varchar(100) NO MUL NULL country_code varchar(2) YES MUL NULL image_url text YES NULL is_anonyme tinyint(1) YES 1 comments_count int YES 0 created_at timestamp YES MUL CURRENT_TIMESTAMP DEFAULT_GENERATED updated_at timestamp YES CURRENT_TIMESTAMP DEFAULT_GENERATED on update CURRENT_TIMESTAMP Indexes: fails 0 PRIMARY 1 id A 40 NULL NULL BTREE YES NULL fails 1 idx_fails_user_id 1 user_id A 10 NULL NULL BTREE YES NULL fails 1 idx_fails_created_at 1 created_at A 40 NULL NULL YES BTREE YES NULL fails 1 idx_fails_user_created 1 user_id A 10 NULL NULL BTREE YES NULL fails 1 idx_fails_user_created 2 created_at A 40 NULL NULL YES BTREE YES NULL fails 1 idx_fails_category_created 1 category A 7 NULL NULL BTREE YES NULL fails 1 idx_fails_category_created 2 created_at A 40 NULL NULL YES BTREE YES NULL fails 1 idx_fail_country 1 country_code A 1 NULL NULL YES BTREE YES NULL Count: total 40 ========================================= TABLE: legal_documents ========================================= Field Type Null Key Default Extra id varchar(36) NO PRI NULL title varchar(255) NO NULL content text NO NULL version varchar(10) NO NULL document_type enum('terms','privacy','community_rules','data_policy') NO NULL is_required tinyint(1) YES 1 is_active tinyint(1) YES 1 created_at timestamp YES CURRENT_TIMESTAMP DEFAULT_GENERATED updated_at timestamp YES CURRENT_TIMESTAMP DEFAULT_GENERATED on update CURRENT_TIMESTAMP Indexes: legal_documents 0 PRIMARY 1 id A 4 NULL NULL BTREE YES NULL Count: total 4 ========================================= TABLE: parental_consents ========================================= Field Type Null Key Default Extra id varchar(36) NO PRI NULL child_user_id varchar(36) NO MUL NULL parent_email varchar(255) NO MUL NULL parent_name varchar(255) YES NULL consent_date timestamp NO NULL consent_ip varchar(45) YES NULL consent_method enum('email','form','phone') YES email verification_code varchar(50) YES MUL NULL is_verified tinyint(1) YES 0 verified_at timestamp YES NULL expires_at timestamp YES NULL created_at timestamp YES CURRENT_TIMESTAMP DEFAULT_GENERATED Indexes: parental_consents 0 PRIMARY 1 id A 0 NULL NULL BTREE YES NULL parental_consents 1 idx_child_user 1 child_user_id A NULL NULL NULL BTREE YES NULL parental_consents 1 idx_parent_email 1 parent_email A NULL 250 NULL BTREE YES NULL parental_consents 1 idx_verification_code 1 verification_code A NULL NULL NULL YES BTREE YES NULL Count: total 0 ========================================= TABLE: password_reset_tokens ========================================= Field Type Null Key Default Extra id char(36) NO PRI NULL user_id char(36) NO MUL NULL token varchar(128) NO UNI NULL expires_at timestamp NO NULL used_at timestamp YES NULL created_at timestamp YES CURRENT_TIMESTAMP DEFAULT_GENERATED Indexes: password_reset_tokens 0 PRIMARY 1 id A 0 NULL NULL BTREE YES NULL password_reset_tokens 0 uniq_token 1 token A 0 NULL NULL BTREE YES NULL password_reset_tokens 1 idx_user 1 user_id A 0 NULL NULL BTREE YES NULL Count: total 0 ========================================= TABLE: pending_profiles ========================================= Field Type Null Key Default Extra id char(36) NO PRI NULL user_id char(36) NO UNI NULL display_name varchar(255) NO UNI NULL legal_consent longtext YES NULL age_verification longtext YES NULL created_at timestamp YES CURRENT_TIMESTAMP DEFAULT_GENERATED Indexes: pending_profiles 0 PRIMARY 1 id A 0 NULL NULL BTREE YES NULL pending_profiles 0 uniq_pending_user 1 user_id A 0 NULL NULL BTREE YES NULL pending_profiles 0 uniq_pending_display_name 1 display_name A 0 NULL NULL BTREE YES NULL Count: total 0 ========================================= TABLE: profiles ========================================= Field Type Null Key Default Extra id char(36) NO PRI NULL user_id char(36) NO UNI NULL username varchar(255) YES UNI NULL display_name varchar(255) YES MUL NULL avatar_url text YES NULL bio text YES NULL registration_completed tinyint(1) YES MUL 0 legal_consent longtext YES NULL age_verification longtext YES NULL preferences longtext YES NULL stats longtext YES NULL created_at timestamp YES CURRENT_TIMESTAMP DEFAULT_GENERATED updated_at timestamp YES CURRENT_TIMESTAMP DEFAULT_GENERATED on update CURRENT_TIMESTAMP Indexes: profiles 0 PRIMARY 1 id A 11 NULL NULL BTREE YES NULL profiles 0 user_id 1 user_id A 11 NULL NULL BTREE YES NULL profiles 0 username 1 username A 2 NULL NULL YES BTREE YES NULL profiles 0 uniq_profiles_username 1 username A 2 NULL NULL YES BTREE YES NULL profiles 1 idx_profiles_display_name 1 display_name A 10 NULL NULL YES BTREE YES NULL profiles 1 idx_profiles_registration 1 registration_completed A 2 NULL NULL YES BTREE YES NULL Count: total 11 ========================================= TABLE: push_errors ========================================= Field Type Null Key Default Extra id int NO PRI NULL auto_increment error_type varchar(50) NO NULL status_code int YES NULL message text YES NULL tokens_count int YES 0 created_at timestamp YES CURRENT_TIMESTAMP DEFAULT_GENERATED Indexes: push_errors 0 PRIMARY 1 id A 0 NULL NULL BTREE YES NULL Count: total 0 ========================================= TABLE: reaction_logs ========================================= Field Type Null Key Default Extra id char(36) NO PRI NULL user_id char(36) NO NULL user_email varchar(255) YES NULL user_name varchar(255) YES NULL fail_id char(36) NO NULL fail_title varchar(255) YES NULL fail_author_name varchar(255) YES NULL reaction_type varchar(50) NO NULL points_awarded int YES 0 timestamp timestamp NO CURRENT_TIMESTAMP DEFAULT_GENERATED ip_address varchar(45) YES NULL user_agent text YES NULL created_at timestamp YES CURRENT_TIMESTAMP DEFAULT_GENERATED Indexes: reaction_logs 0 PRIMARY 1 id A 49 NULL NULL BTREE YES NULL Count: total 54 ========================================= TABLE: reactions ========================================= Field Type Null Key Default Extra id char(36) NO PRI NULL user_id char(36) NO MUL NULL fail_id char(36) NO MUL NULL reaction_type varchar(50) NO NULL created_at timestamp YES CURRENT_TIMESTAMP DEFAULT_GENERATED Indexes: reactions 0 PRIMARY 1 id A 21 NULL NULL BTREE YES NULL reactions 0 unique_user_fail_reaction 1 user_id A 2 NULL NULL BTREE YES NULL reactions 0 unique_user_fail_reaction 2 fail_id A 21 NULL NULL BTREE YES NULL reactions 1 idx_reactions_fail_id 1 fail_id A 20 NULL NULL BTREE YES NULL reactions 1 idx_reactions_user_id 1 user_id A 2 NULL NULL BTREE YES NULL reactions 1 idx_reactions_fail_type 1 fail_id A 20 NULL NULL BTREE YES NULL reactions 1 idx_reactions_fail_type 2 reaction_type A 21 NULL NULL BTREE YES NULL reactions 1 idx_reactions_user_created 1 user_id A 2 NULL NULL BTREE YES NULL reactions 1 idx_reactions_user_created 2 created_at A 21 NULL NULL YES BTREE YES NULL Count: total 21 ========================================= TABLE: request_logs ========================================= Field Type Null Key Default Extra id char(36) NO PRI NULL user_id char(36) YES MUL NULL method varchar(10) NO NULL url varchar(1024) NO NULL status_code int YES MUL NULL response_ms int YES NULL ip_address varchar(45) YES NULL country_code varchar(2) YES NULL user_agent text YES NULL params json YES NULL body json YES NULL created_at timestamp YES MUL CURRENT_TIMESTAMP DEFAULT_GENERATED Indexes: request_logs 0 PRIMARY 1 id A 3192 NULL NULL BTREE YES NULL request_logs 1 idx_user 1 user_id A 1 NULL NULL YES BTREE YES NULL request_logs 1 idx_status 1 status_code A 10 NULL NULL YES BTREE YES NULL request_logs 1 idx_created 1 created_at A 983 NULL NULL YES BTREE YES NULL Count: total 3350 ========================================= TABLE: support_messages ========================================= Field Type Null Key Default Extra id int NO PRI NULL auto_increment user_id char(36) YES MUL NULL type enum('bug','feature','general','content','technical','account') NO MUL general subject varchar(255) NO NULL message text NO NULL admin_notes text YES NULL resolved_by int YES NULL resolved_at timestamp YES NULL email varchar(255) NO NULL status enum('pending','in_progress','resolved','closed') NO MUL pending priority enum('low','medium','high','urgent') NO MUL medium user_agent text YES NULL url varchar(500) YES NULL browser_info json YES NULL created_at timestamp YES MUL CURRENT_TIMESTAMP DEFAULT_GENERATED updated_at timestamp YES CURRENT_TIMESTAMP DEFAULT_GENERATED on update CURRENT_TIMESTAMP Indexes: support_messages 0 PRIMARY 1 id A 0 NULL NULL BTREE YES NULL support_messages 1 idx_user_id 1 user_id A 0 NULL NULL YES BTREE YES NULL support_messages 1 idx_type 1 type A 0 NULL NULL BTREE YES NULL support_messages 1 idx_status 1 status A 0 NULL NULL BTREE YES NULL support_messages 1 idx_priority 1 priority A 0 NULL NULL BTREE YES NULL support_messages 1 idx_created_at 1 created_at A 0 NULL NULL YES BTREE YES NULL support_messages 1 idx_status_priority 1 status A 0 NULL NULL BTREE YES NULL support_messages 1 idx_status_priority 2 priority A 0 NULL NULL BTREE YES NULL support_messages 1 idx_type_status 1 type A 0 NULL NULL BTREE YES NULL support_messages 1 idx_type_status 2 status A 0 NULL NULL BTREE YES NULL Count: total 0 ========================================= TABLE: system_logs ========================================= Field Type Null Key Default Extra id char(36) NO PRI NULL level enum('info','warning','error','debug') NO NULL message text NO NULL action varchar(100) YES NULL details longtext YES NULL user_id char(36) YES MUL NULL timestamp timestamp NO CURRENT_TIMESTAMP DEFAULT_GENERATED created_at timestamp YES CURRENT_TIMESTAMP DEFAULT_GENERATED Indexes: system_logs 0 PRIMARY 1 id A 169 NULL NULL BTREE YES NULL system_logs 1 system_logs_user_id_fkey 1 user_id A 2 NULL NULL YES BTREE YES NULL Count: total 169 ========================================= TABLE: user_activities ========================================= Field Type Null Key Default Extra id char(36) NO PRI NULL user_id char(36) NO MUL NULL user_email varchar(255) YES NULL user_name varchar(255) YES NULL action varchar(100) NO NULL details longtext YES NULL fail_id char(36) YES NULL reaction_type varchar(50) YES NULL ip_address varchar(45) YES NULL user_agent text YES NULL timestamp timestamp NO CURRENT_TIMESTAMP DEFAULT_GENERATED created_at timestamp YES CURRENT_TIMESTAMP DEFAULT_GENERATED Indexes: user_activities 0 PRIMARY 1 id A 133 NULL NULL BTREE YES NULL user_activities 1 idx_user_activities_user_id 1 user_id A 15 NULL NULL BTREE YES NULL Count: total 133 ========================================= TABLE: user_badges ========================================= Field Type Null Key Default Extra id char(36) NO PRI NULL user_id char(36) NO MUL NULL badge_id varchar(100) NO MUL NULL unlocked_at timestamp YES MUL CURRENT_TIMESTAMP DEFAULT_GENERATED created_at timestamp YES CURRENT_TIMESTAMP DEFAULT_GENERATED Indexes: user_badges 0 PRIMARY 1 id A 36 NULL NULL BTREE YES NULL user_badges 0 unique_user_badge 1 user_id A 10 NULL NULL BTREE YES NULL user_badges 0 unique_user_badge 2 badge_id A 36 NULL NULL BTREE YES NULL user_badges 1 idx_user_badges_badge_id 1 badge_id A 11 NULL NULL BTREE YES NULL user_badges 1 idx_user_badges_unlocked 1 unlocked_at A 18 NULL NULL YES BTREE YES NULL Count: total 41 ========================================= TABLE: user_consents ========================================= Field Type Null Key Default Extra id char(36) NO PRI NULL user_id char(36) NO UNI NULL documents json NO NULL accepted_at timestamp YES NULL revoked_at timestamp YES NULL ip_address varchar(64) YES NULL user_agent text YES NULL created_at timestamp YES CURRENT_TIMESTAMP DEFAULT_GENERATED updated_at timestamp YES CURRENT_TIMESTAMP DEFAULT_GENERATED on update CURRENT_TIMESTAMP Indexes: user_consents 0 PRIMARY 1 id A 0 NULL NULL BTREE YES NULL user_consents 0 uniq_user 1 user_id A 0 NULL NULL BTREE YES NULL user_consents 1 idx_user_consents_user 1 user_id A 0 NULL NULL BTREE YES NULL Count: total 0 ========================================= TABLE: user_ip_history ========================================= Field Type Null Key Default Extra id char(36) NO PRI NULL user_id char(36) NO MUL NULL ip_address varchar(45) NO NULL user_agent text YES NULL country_code varchar(2) YES MUL NULL first_seen timestamp YES CURRENT_TIMESTAMP DEFAULT_GENERATED last_seen timestamp YES CURRENT_TIMESTAMP DEFAULT_GENERATED on update CURRENT_TIMESTAMP seen_count int YES 1 Indexes: user_ip_history 0 PRIMARY 1 id A 0 NULL NULL BTREE YES NULL user_ip_history 0 uniq_user_ip 1 user_id A 0 NULL NULL BTREE YES NULL user_ip_history 0 uniq_user_ip 2 ip_address A 0 NULL NULL BTREE YES NULL user_ip_history 1 idx_user 1 user_id A 0 NULL NULL BTREE YES NULL user_ip_history 1 idx_country 1 country_code A 0 NULL NULL YES BTREE YES NULL Count: