diff --git a/src/components/ui/adaptive-text.tsx b/src/components/ui/adaptive-text.tsx index 1e1f6cd..040458e 100644 --- a/src/components/ui/adaptive-text.tsx +++ b/src/components/ui/adaptive-text.tsx @@ -9,6 +9,7 @@ interface AdaptiveTextProps extends React.HTMLAttributes { as?: keyof JSX.IntrinsicElements; preserveWhitespace?: boolean; highlightSyllables?: boolean; + formattedText?: string; } export const AdaptiveText = React.memo(({ @@ -17,11 +18,14 @@ export const AdaptiveText = React.memo(({ as: Component = 'span', preserveWhitespace = false, highlightSyllables = false, + formattedText, className, ...props }: AdaptiveTextProps) => { - const formattedText = formatTextWithSyllables(text, highlightSyllables); - const finalText = isUpperCase ? formattedText.toUpperCase() : formattedText; + // Se tiver texto formatado (com sílabas), usa ele + // Senão, formata o texto normal + const finalText = formattedText || formatTextWithSyllables(text, highlightSyllables); + const displayText = isUpperCase ? finalText.toUpperCase() : finalText; return React.createElement( Component, @@ -32,7 +36,7 @@ export const AdaptiveText = React.memo(({ ), ...props }, - finalText + displayText ); }); diff --git a/src/features/syllables/hooks/useSyllables.ts b/src/features/syllables/hooks/useSyllables.ts index f6d65e8..74ca9b5 100644 --- a/src/features/syllables/hooks/useSyllables.ts +++ b/src/features/syllables/hooks/useSyllables.ts @@ -1,10 +1,40 @@ import { useState } from 'react'; +import { formatTextWithSyllables } from '../utils/syllableSplitter'; -export function useSyllables() { +interface UseSyllablesProps { + text: string; + textSyllables?: string | null; +} + +export function useSyllables({ text, textSyllables }: UseSyllablesProps) { const [isHighlighted, setIsHighlighted] = useState(false); + // Se não estiver destacado, mostra o texto normal + if (!isHighlighted) { + return { + isHighlighted, + toggleHighlight: () => setIsHighlighted(!isHighlighted), + displayText: text, + isUsingDatabaseText: false + }; + } + + // Se estiver destacado e tiver texto com sílabas do banco, usa ele + if (textSyllables) { + return { + isHighlighted, + toggleHighlight: () => setIsHighlighted(!isHighlighted), + displayText: textSyllables, + isUsingDatabaseText: true + }; + } + + // Se estiver destacado mas não tiver texto com sílabas do banco, + // gera usando o syllableSplitter return { isHighlighted, - toggleHighlight: () => setIsHighlighted(!isHighlighted) + toggleHighlight: () => setIsHighlighted(!isHighlighted), + displayText: formatTextWithSyllables(text, true), + isUsingDatabaseText: false }; } \ No newline at end of file diff --git a/src/pages/student-dashboard/StoryPage.tsx b/src/pages/student-dashboard/StoryPage.tsx index 078277e..da4079b 100644 --- a/src/pages/student-dashboard/StoryPage.tsx +++ b/src/pages/student-dashboard/StoryPage.tsx @@ -1,5 +1,5 @@ import React, { useState, useEffect } from 'react'; -import { ArrowLeft, ArrowRight, Share2, ChevronDown, ChevronUp, Loader2, Download, RefreshCw, Trash2, Type, Eye, EyeOff } from 'lucide-react'; +import { ArrowLeft, ArrowRight, ChevronDown, ChevronUp, Loader2, Download, RefreshCw, Trash2, Eye, EyeOff } from 'lucide-react'; import { useParams, useNavigate } from 'react-router-dom'; import { supabase } from '../../lib/supabase'; import { AudioRecorder } from '../../components/story/AudioRecorder'; @@ -8,7 +8,6 @@ import { StoryMetrics } from '../../components/story/StoryMetrics'; import { convertWebmToMp3 } from '../../utils/audioConverter'; import * as Dialog from '@radix-ui/react-dialog'; import { ExerciseSuggestions } from '../../components/learning/ExerciseSuggestions'; -import { TextCaseToggle } from '../../components/ui/text-case-toggle'; import { AdaptiveText } from '../../components/ui/adaptive-text'; import { useSession } from '../../hooks/useSession'; import { useSyllables } from '../../features/syllables/hooks/useSyllables'; @@ -56,7 +55,10 @@ function RecordingHistoryCard({ recording }: { recording: StoryRecording }) { const [conversionError, setConversionError] = React.useState(null); const { session } = useSession(); const { isUpperCase } = useUppercasePreference(session?.user?.id); - const { isHighlighted } = useSyllables(); + const { isHighlighted, displayText } = useSyllables({ + text: recording.transcription || '', + textSyllables: null + }); // Verificar suporte ao formato WebM React.useEffect(() => { @@ -293,6 +295,7 @@ function RecordingHistoryCard({ recording }: { recording: StoryRecording }) { isUpperCase={isUpperCase} className="text-sm text-gray-600 whitespace-pre-wrap" highlightSyllables={isHighlighted} + formattedText={displayText} /> @@ -393,7 +396,10 @@ export function StoryPage() { const [isDeleting, setIsDeleting] = useState(false); const { session } = useSession(); const { isUpperCase, toggleUppercase, isLoading } = useUppercasePreference(session?.user?.id); - const { isHighlighted: isSyllablesEnabled, toggleHighlight: toggleSyllables } = useSyllables(); + const { isHighlighted: isSyllablesEnabled, toggleHighlight: toggleSyllables, displayText } = useSyllables({ + text: story?.content?.pages?.[currentPage]?.text || '', + textSyllables: story?.content?.pages?.[currentPage]?.text_syllables || null + }); const [fontSize, setFontSize] = useState(24); const [readingSpeed, setReadingSpeed] = useState(60); // 60 palavras por minuto const [letterSpacing, setLetterSpacing] = useState(0); @@ -450,14 +456,15 @@ export function StoryPage() { if (!text || currentWordIndex === -1) { return ( ); } - const words = getWords(text); + const words = getWords(displayText); return (
{words.map((word, index) => ( @@ -473,6 +480,7 @@ export function StoryPage() { text={word} isUpperCase={isUpperCase} highlightSyllables={isSyllablesEnabled} + formattedText={word} /> {' '} @@ -495,6 +503,7 @@ export function StoryPage() { id, page_number, text, + text_syllables, image_url ) `) @@ -508,8 +517,9 @@ export function StoryPage() { setStory({ ...storyData, content: { - pages: orderedPages.map((page: { text: string; image_url: string }) => ({ + pages: orderedPages.map((page: { text: string; text_syllables: string | null; image_url: string }) => ({ text: page.text, + text_syllables: page.text_syllables, image: page.image_url })) } @@ -557,20 +567,6 @@ export function StoryPage() { fetchRecordings(); }, [story?.id]); - const handleShare = async () => { - if (navigator.share) { - try { - await navigator.share({ - title: story?.title, - text: 'Confira minha história!', - url: window.location.href - }); - } catch (err) { - console.error('Erro ao compartilhar:', err); - } - } - }; - const getLatestRecording = () => recordings[0]; const formatMetricsData = (recording: StoryRecording) => ({ @@ -802,18 +798,6 @@ export function StoryPage() { focusModeActive={focusMode.isActive} onFocusModeToggle={handleFocusModeToggle} /> - - - {/* - - */} -
diff --git a/src/types/database.ts b/src/types/database.ts index 6c4ee04..0536de4 100644 --- a/src/types/database.ts +++ b/src/types/database.ts @@ -76,7 +76,11 @@ export interface Story extends BaseEntity { title: string; theme: string; content: { - pages: StoryPage[]; + pages: Array<{ + text: string; + text_syllables?: string | null; + image: string; + }>; currentPage?: number; lastModified?: string; }; @@ -88,6 +92,11 @@ export interface Story extends BaseEntity { students?: { name: string; }; + theme_id?: string; + subject_id?: string; + character_id?: string; + setting_id?: string; + context?: string; } export interface StoryRecording extends BaseEntity { diff --git a/supabase/contexts/constraints.md b/supabase/contexts/constraints.md index cecd670..202a53a 100644 --- a/supabase/contexts/constraints.md +++ b/supabase/contexts/constraints.md @@ -1,34 +1,105 @@ | table_schema | table_name | column_name | constraint_type | | ------------------- | ------------------------------- | --------------------- | --------------- | -| public | story_exercise_words | id | PRIMARY KEY | -| public | story_exercise_words | story_id | FOREIGN KEY | -| public | story_exercise_words | story_id | UNIQUE | -| public | story_exercise_words | word | UNIQUE | -| public | story_exercise_words | exercise_type | UNIQUE | -| public | story_exercise_words | | CHECK | -| public | story_pages | story_id | FOREIGN KEY | -| public | story_pages | story_id | FOREIGN KEY | -| public | story_pages | id | PRIMARY KEY | -| public | story_generations | id | PRIMARY KEY | -| public | story_generations | story_id | FOREIGN KEY | +| auth | users | id | PRIMARY KEY | | public | schools | id | PRIMARY KEY | -| public | teachers | email | UNIQUE | +| auth | refresh_tokens | id | PRIMARY KEY | +| auth | instances | id | PRIMARY KEY | +| auth | audit_log_entries | id | PRIMARY KEY | +| auth | schema_migrations | version | PRIMARY KEY | +| storage | buckets | id | PRIMARY KEY | | public | teachers | id | PRIMARY KEY | +| storage | objects | id | PRIMARY KEY | +| storage | objects | bucket_id | FOREIGN KEY | +| public | teachers | email | UNIQUE | +| storage | migrations | id | PRIMARY KEY | +| storage | migrations | name | UNIQUE | +| pgsodium | key | id | PRIMARY KEY | +| pgsodium | key | parent_key | FOREIGN KEY | +| pgsodium | key | name | UNIQUE | | public | teachers | school_id | FOREIGN KEY | -| public | teachers | | CHECK | | public | classes | id | PRIMARY KEY | | public | classes | school_id | FOREIGN KEY | -| public | classes | teacher_id | FOREIGN KEY | -| public | teacher_classes | class_id | FOREIGN KEY | +| vault | secrets | id | PRIMARY KEY | +| vault | secrets | key_id | FOREIGN KEY | +| public | students | id | PRIMARY KEY | +| public | students | email | UNIQUE | +| public | students | class_id | FOREIGN KEY | | public | teacher_classes | id | PRIMARY KEY | | public | teacher_classes | teacher_id | UNIQUE | | public | teacher_classes | class_id | UNIQUE | | public | teacher_classes | teacher_id | FOREIGN KEY | -| public | students | class_id | FOREIGN KEY | -| public | students | email | UNIQUE | -| public | students | id | PRIMARY KEY | +| public | teacher_classes | class_id | FOREIGN KEY | +| public | student_achievements_old | id | PRIMARY KEY | +| public | student_achievements_old | student_id | FOREIGN KEY | +| public | student_achievements_old | achievement_id | FOREIGN KEY | +| public | phonics_exercise_types | id | PRIMARY KEY | +| public | phonics_exercises | id | PRIMARY KEY | +| public | phonics_exercises | type_id | FOREIGN KEY | +| public | story_exercise_words | id | PRIMARY KEY | +| public | story_exercise_words | story_id | UNIQUE | +| public | story_exercise_words | word | UNIQUE | +| public | story_exercise_words | exercise_type | UNIQUE | +| public | story_exercise_words | story_id | FOREIGN KEY | +| public | phonics_words | id | PRIMARY KEY | +| public | phonics_exercise_words | id | PRIMARY KEY | +| public | phonics_exercise_words | exercise_id | UNIQUE | +| public | phonics_exercise_words | word_id | UNIQUE | +| public | phonics_exercise_words | exercise_id | FOREIGN KEY | +| public | phonics_exercise_words | word_id | FOREIGN KEY | +| public | stories | id | PRIMARY KEY | +| public | stories | student_id | FOREIGN KEY | +| public | student_achievements | id | PRIMARY KEY | +| public | student_achievements | student_id | FOREIGN KEY | +| public | student_achievements | achievement_id | FOREIGN KEY | +| public | media_types | id | PRIMARY KEY | +| public | phonics_exercise_media | id | PRIMARY KEY | +| public | phonics_exercise_media | exercise_id | FOREIGN KEY | +| public | phonics_exercise_media | media_type_id | FOREIGN KEY | +| public | student_phonics_progress | id | PRIMARY KEY | +| public | student_phonics_progress | student_id | UNIQUE | +| public | student_phonics_progress | exercise_id | UNIQUE | +| public | student_phonics_progress | student_id | FOREIGN KEY | +| public | student_phonics_progress | exercise_id | FOREIGN KEY | +| public | student_phonics_attempts | id | PRIMARY KEY | +| public | student_phonics_attempts | student_id | FOREIGN KEY | +| public | student_phonics_attempts | exercise_id | FOREIGN KEY | +| public | student_phonics_attempt_answers | id | PRIMARY KEY | +| public | student_phonics_attempt_answers | attempt_id | FOREIGN KEY | +| public | student_phonics_attempt_answers | word_id | FOREIGN KEY | +| public | achievement_types | id | PRIMARY KEY | +| public | phonics_achievements | id | PRIMARY KEY | +| public | phonics_achievements | type_id | FOREIGN KEY | +| public | student_phonics_achievements | id | PRIMARY KEY | +| public | student_phonics_achievements | student_id | UNIQUE | +| public | student_phonics_achievements | achievement_id | UNIQUE | +| public | student_phonics_achievements | student_id | FOREIGN KEY | +| public | student_phonics_achievements | achievement_id | FOREIGN KEY | +| public | teacher_invites | id | PRIMARY KEY | +| public | teacher_invites | token | UNIQUE | +| public | teacher_invites | school_id | FOREIGN KEY | +| public | classes | teacher_id | FOREIGN KEY | +| public | story_pages | id | PRIMARY KEY | +| public | languages | id | PRIMARY KEY | +| public | story_generations | id | PRIMARY KEY | +| public | story_generations | story_id | FOREIGN KEY | +| public | interests | id | PRIMARY KEY | +| public | interests | student_id | UNIQUE | +| public | interests | category | UNIQUE | +| public | interests | item | UNIQUE | +| public | interests | student_id | FOREIGN KEY | +| public | languages | code | UNIQUE | +| supabase_migrations | schema_migrations | version | PRIMARY KEY | +| supabase_migrations | seed_files | path | PRIMARY KEY | +| public | phonics_categories | id | PRIMARY KEY | | public | students | school_id | FOREIGN KEY | -| public | students | | CHECK | +| public | story_pages | story_id | FOREIGN KEY | +| public | story_recordings | story_id | FOREIGN KEY | +| public | story_pages | story_id | FOREIGN KEY | +| public | story_recordings | story_id | FOREIGN KEY | +| public | phonics_word_audio | id | PRIMARY KEY | +| public | phonics_word_audio | word | UNIQUE | +| public | story_recordings | id | PRIMARY KEY | +| public | story_recordings | student_id | FOREIGN KEY | | public | story_themes | id | PRIMARY KEY | | public | story_themes | slug | UNIQUE | | public | story_subjects | id | PRIMARY KEY | @@ -37,381 +108,310 @@ | public | story_characters | slug | UNIQUE | | public | story_settings | id | PRIMARY KEY | | public | story_settings | slug | UNIQUE | +| public | stories | theme_id | FOREIGN KEY | +| public | stories | subject_id | FOREIGN KEY | | public | stories | character_id | FOREIGN KEY | | public | stories | setting_id | FOREIGN KEY | -| public | stories | subject_id | FOREIGN KEY | -| public | stories | theme_id | FOREIGN KEY | -| public | stories | character_id | FOREIGN KEY | -| public | stories | id | PRIMARY KEY | -| public | stories | setting_id | FOREIGN KEY | -| public | stories | | CHECK | -| public | stories | student_id | FOREIGN KEY | -| public | stories | subject_id | FOREIGN KEY | -| public | stories | theme_id | FOREIGN KEY | -| public | teacher_invites | id | PRIMARY KEY | -| public | teacher_invites | school_id | FOREIGN KEY | -| public | teacher_invites | | CHECK | -| public | teacher_invites | token | UNIQUE | -| public | phonics_exercise_types | id | PRIMARY KEY | -| public | phonics_exercises | id | PRIMARY KEY | -| public | phonics_exercises | type_id | FOREIGN KEY | -| public | phonics_words | id | PRIMARY KEY | -| public | phonics_exercise_words | exercise_id | FOREIGN KEY | -| public | phonics_exercise_words | exercise_id | UNIQUE | -| public | phonics_exercise_words | word_id | UNIQUE | -| public | phonics_exercise_words | id | PRIMARY KEY | -| public | phonics_exercise_words | word_id | FOREIGN KEY | -| public | phonics_categories | id | PRIMARY KEY | -| public | phonics_exercise_media | exercise_id | FOREIGN KEY | -| public | phonics_exercise_media | media_type_id | FOREIGN KEY | -| public | phonics_exercise_media | id | PRIMARY KEY | -| public | student_phonics_attempt_answers | attempt_id | FOREIGN KEY | -| public | student_phonics_attempt_answers | id | PRIMARY KEY | -| public | student_phonics_attempt_answers | word_id | FOREIGN KEY | -| public | media_types | id | PRIMARY KEY | -| public | student_phonics_progress | exercise_id | FOREIGN KEY | -| public | student_phonics_progress | id | PRIMARY KEY | -| public | student_phonics_progress | student_id | UNIQUE | -| public | student_phonics_progress | exercise_id | UNIQUE | -| public | student_phonics_progress | student_id | FOREIGN KEY | -| public | student_phonics_attempts | exercise_id | FOREIGN KEY | -| public | student_phonics_attempts | id | PRIMARY KEY | -| public | student_phonics_attempts | student_id | FOREIGN KEY | -| public | achievement_types | id | PRIMARY KEY | -| public | phonics_achievements | id | PRIMARY KEY | -| public | phonics_achievements | type_id | FOREIGN KEY | -| public | student_phonics_achievements | achievement_id | FOREIGN KEY | -| public | student_phonics_achievements | id | PRIMARY KEY | -| public | student_phonics_achievements | student_id | UNIQUE | -| public | student_phonics_achievements | achievement_id | UNIQUE | -| public | student_phonics_achievements | student_id | FOREIGN KEY | -| public | phonics_word_audio | id | PRIMARY KEY | -| public | phonics_word_audio | word | UNIQUE | -| public | languages | code | UNIQUE | -| public | languages | id | PRIMARY KEY | -| public | story_recordings | story_id | FOREIGN KEY | -| public | story_recordings | story_id | FOREIGN KEY | -| public | story_recordings | | CHECK | -| public | story_recordings | | CHECK | -| public | story_recordings | | CHECK | -| public | story_recordings | id | PRIMARY KEY | -| public | story_recordings | | CHECK | -| public | story_recordings | student_id | FOREIGN KEY | -| public | interests | id | PRIMARY KEY | -| public | interests | student_id | UNIQUE | -| public | interests | category | UNIQUE | -| public | interests | item | UNIQUE | -| public | interests | student_id | FOREIGN KEY | -| public | achievements | id | PRIMARY KEY | -| public | student_achievements_old | achievement_id | FOREIGN KEY | -| public | student_achievements_old | id | PRIMARY KEY | -| public | student_achievements_old | student_id | FOREIGN KEY | -| public | student_achievements | achievement_id | FOREIGN KEY | -| public | student_achievements | id | PRIMARY KEY | -| public | student_achievements | student_id | FOREIGN KEY | -| storage | buckets | id | PRIMARY KEY | -| storage | migrations | name | UNIQUE | -| storage | migrations | id | PRIMARY KEY | -| storage | objects | bucket_id | FOREIGN KEY | -| storage | objects | id | PRIMARY KEY | -| storage | s3_multipart_uploads | bucket_id | FOREIGN KEY | -| storage | s3_multipart_uploads | id | PRIMARY KEY | -| storage | s3_multipart_uploads_parts | bucket_id | FOREIGN KEY | -| storage | s3_multipart_uploads_parts | id | PRIMARY KEY | -| storage | s3_multipart_uploads_parts | upload_id | FOREIGN KEY | -| auth | refresh_tokens | id | PRIMARY KEY | -| auth | refresh_tokens | session_id | FOREIGN KEY | +| auth | identities | user_id | FOREIGN KEY | | auth | refresh_tokens | token | UNIQUE | -| auth | instances | id | PRIMARY KEY | -| auth | schema_migrations | version | PRIMARY KEY | -| auth | users | | CHECK | -| auth | users | phone | UNIQUE | -| auth | users | id | PRIMARY KEY | -| auth | sso_providers | | CHECK | -| auth | sso_providers | id | PRIMARY KEY | -| auth | saml_relay_states | | CHECK | -| auth | saml_relay_states | flow_state_id | FOREIGN KEY | -| auth | saml_relay_states | id | PRIMARY KEY | -| auth | saml_relay_states | sso_provider_id | FOREIGN KEY | -| auth | flow_state | id | PRIMARY KEY | -| auth | one_time_tokens | id | PRIMARY KEY | -| auth | one_time_tokens | | CHECK | -| auth | one_time_tokens | user_id | FOREIGN KEY | -| auth | audit_log_entries | id | PRIMARY KEY | -| auth | mfa_factors | last_challenged_at | UNIQUE | -| auth | mfa_factors | id | PRIMARY KEY | -| auth | mfa_factors | user_id | FOREIGN KEY | | auth | sessions | id | PRIMARY KEY | | auth | sessions | user_id | FOREIGN KEY | -| auth | sso_domains | | CHECK | -| auth | sso_domains | id | PRIMARY KEY | -| auth | sso_domains | sso_provider_id | FOREIGN KEY | -| auth | mfa_challenges | factor_id | FOREIGN KEY | +| auth | refresh_tokens | session_id | FOREIGN KEY | +| auth | mfa_factors | id | PRIMARY KEY | +| auth | mfa_factors | user_id | FOREIGN KEY | | auth | mfa_challenges | id | PRIMARY KEY | -| auth | mfa_amr_claims | id | PRIMARY KEY | +| auth | mfa_challenges | factor_id | FOREIGN KEY | | auth | mfa_amr_claims | session_id | UNIQUE | | auth | mfa_amr_claims | authentication_method | UNIQUE | | auth | mfa_amr_claims | session_id | FOREIGN KEY | -| auth | saml_providers | | CHECK | -| auth | saml_providers | | CHECK | -| auth | saml_providers | | CHECK | -| auth | saml_providers | entity_id | UNIQUE | +| auth | mfa_amr_claims | id | PRIMARY KEY | +| auth | sso_providers | id | PRIMARY KEY | +| auth | sso_domains | id | PRIMARY KEY | +| auth | sso_domains | sso_provider_id | FOREIGN KEY | | auth | saml_providers | id | PRIMARY KEY | +| auth | saml_providers | entity_id | UNIQUE | | auth | saml_providers | sso_provider_id | FOREIGN KEY | +| auth | saml_relay_states | id | PRIMARY KEY | +| auth | saml_relay_states | sso_provider_id | FOREIGN KEY | +| auth | users | phone | UNIQUE | +| auth | flow_state | id | PRIMARY KEY | +| auth | saml_relay_states | flow_state_id | FOREIGN KEY | | auth | identities | id | PRIMARY KEY | -| auth | identities | provider | UNIQUE | | auth | identities | provider_id | UNIQUE | -| auth | identities | user_id | FOREIGN KEY | +| auth | identities | provider | UNIQUE | +| auth | one_time_tokens | id | PRIMARY KEY | +| auth | one_time_tokens | user_id | FOREIGN KEY | +| public | achievements | id | PRIMARY KEY | +| auth | mfa_factors | last_challenged_at | UNIQUE | +| storage | s3_multipart_uploads | id | PRIMARY KEY | +| storage | s3_multipart_uploads | bucket_id | FOREIGN KEY | +| storage | s3_multipart_uploads_parts | id | PRIMARY KEY | +| storage | s3_multipart_uploads_parts | upload_id | FOREIGN KEY | +| storage | s3_multipart_uploads_parts | bucket_id | FOREIGN KEY | | realtime | schema_migrations | version | PRIMARY KEY | | realtime | subscription | id | PRIMARY KEY | +| public | stories | theme_id | FOREIGN KEY | +| public | stories | subject_id | FOREIGN KEY | +| public | stories | character_id | FOREIGN KEY | +| public | stories | setting_id | FOREIGN KEY | | realtime | messages | id | PRIMARY KEY | | realtime | messages | inserted_at | PRIMARY KEY | -| pgsodium | key | | CHECK | -| pgsodium | key | parent_key | FOREIGN KEY | -| pgsodium | key | id | PRIMARY KEY | -| pgsodium | key | name | UNIQUE | -| pgsodium | key | | CHECK | -| vault | secrets | key_id | FOREIGN KEY | -| vault | secrets | id | PRIMARY KEY | -| supabase_migrations | schema_migrations | version | PRIMARY KEY | -| supabase_migrations | seed_files | path | PRIMARY KEY | -| public | story_exercise_words | | CHECK | -| public | story_exercise_words | | CHECK | -| public | story_exercise_words | | CHECK | -| public | story_pages | | CHECK | -| public | story_pages | | CHECK | -| public | story_pages | | CHECK | -| public | story_pages | | CHECK | -| public | story_pages | | CHECK | -| public | story_generations | | CHECK | -| public | story_generations | | CHECK | -| public | story_generations | | CHECK | -| public | story_generations | | CHECK | -| public | story_generations | | CHECK | -| public | story_generations | | CHECK | -| public | schools | | CHECK | -| public | schools | | CHECK | -| public | schools | | CHECK | -| public | schools | | CHECK | -| public | schools | | CHECK | -| public | teachers | | CHECK | -| public | teachers | | CHECK | -| public | teachers | | CHECK | -| public | teachers | | CHECK | -| public | teachers | | CHECK | -| public | teachers | | CHECK | -| public | classes | | CHECK | -| public | classes | | CHECK | -| public | classes | | CHECK | -| public | classes | | CHECK | -| public | classes | | CHECK | -| public | classes | | CHECK | -| public | classes | | CHECK | -| public | teacher_classes | | CHECK | -| public | teacher_classes | | CHECK | -| public | teacher_classes | | CHECK | -| public | teacher_classes | | CHECK | -| public | students | | CHECK | -| public | students | | CHECK | -| public | students | | CHECK | -| public | students | | CHECK | -| public | students | | CHECK | -| public | students | | CHECK | -| public | students | | CHECK | -| public | students | | CHECK | -| public | story_themes | | CHECK | -| public | story_themes | | CHECK | -| public | story_themes | | CHECK | -| public | story_themes | | CHECK | -| public | story_themes | | CHECK | -| public | story_themes | | CHECK | -| public | story_themes | | CHECK | -| public | story_subjects | | CHECK | -| public | story_subjects | | CHECK | -| public | story_subjects | | CHECK | -| public | story_subjects | | CHECK | -| public | story_subjects | | CHECK | -| public | story_subjects | | CHECK | -| public | story_subjects | | CHECK | -| public | story_characters | | CHECK | -| public | story_characters | | CHECK | -| public | story_characters | | CHECK | -| public | story_characters | | CHECK | -| public | story_characters | | CHECK | -| public | story_characters | | CHECK | -| public | story_characters | | CHECK | -| public | story_settings | | CHECK | -| public | story_settings | | CHECK | -| public | story_settings | | CHECK | -| public | story_settings | | CHECK | -| public | story_settings | | CHECK | -| public | story_settings | | CHECK | -| public | story_settings | | CHECK | -| public | stories | | CHECK | -| public | stories | | CHECK | -| public | stories | | CHECK | -| public | stories | | CHECK | -| public | stories | | CHECK | -| public | stories | | CHECK | -| public | stories | | CHECK | -| public | teacher_invites | | CHECK | -| public | teacher_invites | | CHECK | -| public | teacher_invites | | CHECK | -| public | teacher_invites | | CHECK | -| public | teacher_invites | | CHECK | -| public | teacher_invites | | CHECK | -| public | teacher_invites | | CHECK | -| public | phonics_exercise_types | | CHECK | -| public | phonics_exercise_types | | CHECK | -| public | phonics_exercises | | CHECK | -| public | phonics_exercises | | CHECK | -| public | phonics_exercises | | CHECK | -| public | phonics_exercises | | CHECK | -| public | phonics_words | | CHECK | -| public | phonics_words | | CHECK | -| public | phonics_words | | CHECK | -| public | phonics_exercise_words | | CHECK | -| public | phonics_categories | | CHECK | -| public | phonics_categories | | CHECK | -| public | phonics_categories | | CHECK | -| public | phonics_categories | | CHECK | -| public | phonics_exercise_media | | CHECK | -| public | phonics_exercise_media | | CHECK | -| public | student_phonics_attempt_answers | | CHECK | -| public | student_phonics_attempt_answers | | CHECK | -| public | media_types | | CHECK | -| public | media_types | | CHECK | -| public | student_phonics_progress | | CHECK | -| public | student_phonics_attempts | | CHECK | -| public | student_phonics_attempts | | CHECK | -| public | achievement_types | | CHECK | -| public | achievement_types | | CHECK | -| public | phonics_achievements | | CHECK | -| public | phonics_achievements | | CHECK | -| public | student_phonics_achievements | | CHECK | -| public | phonics_word_audio | | CHECK | -| public | phonics_word_audio | | CHECK | -| public | phonics_word_audio | | CHECK | -| public | phonics_word_audio | | CHECK | -| public | languages | | CHECK | -| public | languages | | CHECK | -| public | languages | | CHECK | -| public | languages | | CHECK | -| public | languages | | CHECK | -| public | story_recordings | | CHECK | -| public | story_recordings | | CHECK | -| public | story_recordings | | CHECK | -| public | interests | | CHECK | -| public | interests | | CHECK | -| public | interests | | CHECK | -| public | interests | | CHECK | -| public | interests | | CHECK | -| public | interests | | CHECK | -| public | achievements | | CHECK | -| public | student_achievements_old | | CHECK | -| public | student_achievements | | CHECK | -| storage | buckets | | CHECK | -| storage | buckets | | CHECK | -| storage | migrations | | CHECK | -| storage | migrations | | CHECK | -| storage | migrations | | CHECK | -| storage | objects | | CHECK | -| storage | s3_multipart_uploads | | CHECK | -| storage | s3_multipart_uploads | | CHECK | -| storage | s3_multipart_uploads | | CHECK | -| storage | s3_multipart_uploads | | CHECK | -| storage | s3_multipart_uploads | | CHECK | -| storage | s3_multipart_uploads | | CHECK | -| storage | s3_multipart_uploads | | CHECK | -| storage | s3_multipart_uploads_parts | | CHECK | -| storage | s3_multipart_uploads_parts | | CHECK | -| storage | s3_multipart_uploads_parts | | CHECK | -| storage | s3_multipart_uploads_parts | | CHECK | -| storage | s3_multipart_uploads_parts | | CHECK | -| storage | s3_multipart_uploads_parts | | CHECK | -| storage | s3_multipart_uploads_parts | | CHECK | -| storage | s3_multipart_uploads_parts | | CHECK | -| storage | s3_multipart_uploads_parts | | CHECK | -| auth | refresh_tokens | | CHECK | -| auth | instances | | CHECK | -| auth | schema_migrations | | CHECK | -| auth | users | | CHECK | -| auth | users | | CHECK | -| auth | users | | CHECK | -| auth | sso_providers | | CHECK | -| auth | saml_relay_states | | CHECK | -| auth | saml_relay_states | | CHECK | -| auth | saml_relay_states | | CHECK | -| auth | flow_state | | CHECK | -| auth | flow_state | | CHECK | -| auth | flow_state | | CHECK | -| auth | flow_state | | CHECK | -| auth | flow_state | | CHECK | -| auth | flow_state | | CHECK | -| auth | one_time_tokens | | CHECK | -| auth | one_time_tokens | | CHECK | -| auth | one_time_tokens | | CHECK | -| auth | one_time_tokens | | CHECK | -| auth | one_time_tokens | | CHECK | -| auth | one_time_tokens | | CHECK | -| auth | one_time_tokens | | CHECK | -| auth | audit_log_entries | | CHECK | -| auth | audit_log_entries | | CHECK | -| auth | mfa_factors | | CHECK | -| auth | mfa_factors | | CHECK | -| auth | mfa_factors | | CHECK | -| auth | mfa_factors | | CHECK | -| auth | mfa_factors | | CHECK | -| auth | mfa_factors | | CHECK | -| auth | sessions | | CHECK | -| auth | sessions | | CHECK | -| auth | sso_domains | | CHECK | -| auth | sso_domains | | CHECK | -| auth | sso_domains | | CHECK | -| auth | mfa_challenges | | CHECK | -| auth | mfa_challenges | | CHECK | -| auth | mfa_challenges | | CHECK | -| auth | mfa_challenges | | CHECK | -| auth | mfa_amr_claims | | CHECK | -| auth | mfa_amr_claims | | CHECK | -| auth | mfa_amr_claims | | CHECK | -| auth | mfa_amr_claims | | CHECK | -| auth | mfa_amr_claims | | CHECK | -| auth | saml_providers | | CHECK | -| auth | saml_providers | | CHECK | -| auth | saml_providers | | CHECK | -| auth | saml_providers | | CHECK | -| auth | identities | | CHECK | -| auth | identities | | CHECK | -| auth | identities | | CHECK | -| auth | identities | | CHECK | -| auth | identities | | CHECK | -| realtime | schema_migrations | | CHECK | -| realtime | subscription | | CHECK | -| realtime | subscription | | CHECK | -| realtime | subscription | | CHECK | -| realtime | subscription | | CHECK | -| realtime | subscription | | CHECK | -| realtime | subscription | | CHECK | -| realtime | subscription | | CHECK | -| realtime | messages | | CHECK | -| realtime | messages | | CHECK | -| realtime | messages | | CHECK | -| realtime | messages | | CHECK | -| realtime | messages | | CHECK | -| pgsodium | key | | CHECK | -| pgsodium | key | | CHECK | -| vault | secrets | | CHECK | -| vault | secrets | | CHECK | -| vault | secrets | | CHECK | -| vault | secrets | | CHECK | -| vault | secrets | | CHECK | -| supabase_migrations | schema_migrations | | CHECK | -| supabase_migrations | seed_files | | CHECK | -| supabase_migrations | seed_files | | CHECK | -| net | http_request_queue | | CHECK | -| net | http_request_queue | | CHECK | -| net | http_request_queue | | CHECK | -| net | http_request_queue | | CHECK | -| net | http_request_queue | | CHECK | -| net | _http_response | | CHECK | \ No newline at end of file +| public | story_subjects | null | CHECK | +| public | story_recordings | null | CHECK | +| public | story_characters | null | CHECK | +| public | schools | null | CHECK | +| public | story_themes | null | CHECK | +| auth | mfa_amr_claims | null | CHECK | +| public | phonics_exercises | null | CHECK | +| public | teacher_invites | null | CHECK | +| storage | migrations | null | CHECK | +| public | story_settings | null | CHECK | +| realtime | subscription | null | CHECK | +| public | students | null | CHECK | +| public | stories | null | CHECK | +| auth | mfa_amr_claims | null | CHECK | +| public | story_recordings | null | CHECK | +| public | students | null | CHECK | +| public | phonics_word_audio | null | CHECK | +| public | languages | null | CHECK | +| pgsodium | key | null | CHECK | +| public | phonics_word_audio | null | CHECK | +| realtime | messages | null | CHECK | +| public | achievements | null | CHECK | +| public | phonics_exercise_types | null | CHECK | +| public | teacher_invites | null | CHECK | +| auth | users | null | CHECK | +| supabase_migrations | seed_files | null | CHECK | +| public | students | null | CHECK | +| auth | refresh_tokens | null | CHECK | +| pgsodium | key | null | CHECK | +| public | student_phonics_attempt_answers | null | CHECK | +| auth | identities | null | CHECK | +| storage | s3_multipart_uploads | null | CHECK | +| auth | flow_state | null | CHECK | +| auth | mfa_factors | null | CHECK | +| public | phonics_words | null | CHECK | +| public | stories | null | CHECK | +| public | story_subjects | null | CHECK | +| auth | flow_state | null | CHECK | +| public | phonics_words | null | CHECK | +| realtime | subscription | null | CHECK | +| auth | sso_domains | null | CHECK | +| public | story_settings | null | CHECK | +| auth | users | null | CHECK | +| public | phonics_categories | null | CHECK | +| public | teacher_invites | null | CHECK | +| public | stories | null | CHECK | +| public | story_themes | null | CHECK | +| storage | s3_multipart_uploads_parts | null | CHECK | +| public | teachers | null | CHECK | +| public | teachers | null | CHECK | +| public | story_themes | null | CHECK | +| public | phonics_exercise_words | null | CHECK | +| public | students | null | CHECK | +| realtime | subscription | null | CHECK | +| auth | mfa_amr_claims | null | CHECK | +| public | teacher_classes | null | CHECK | +| auth | flow_state | null | CHECK | +| public | students | null | CHECK | +| public | story_characters | null | CHECK | +| auth | mfa_factors | null | CHECK | +| realtime | schema_migrations | null | CHECK | +| public | languages | null | CHECK | +| public | stories | null | CHECK | +| public | phonics_word_audio | null | CHECK | +| pgsodium | key | null | CHECK | +| storage | s3_multipart_uploads | null | CHECK | +| auth | saml_providers | null | CHECK | +| auth | saml_providers | null | CHECK | +| storage | s3_multipart_uploads_parts | null | CHECK | +| public | story_characters | null | CHECK | +| storage | s3_multipart_uploads | null | CHECK | +| public | interests | null | CHECK | +| public | story_generations | null | CHECK | +| vault | secrets | null | CHECK | +| public | students | null | CHECK | +| vault | secrets | null | CHECK | +| auth | users | null | CHECK | +| public | story_themes | null | CHECK | +| public | classes | null | CHECK | +| auth | mfa_amr_claims | null | CHECK | +| auth | identities | null | CHECK | +| public | story_generations | null | CHECK | +| public | story_exercise_words | null | CHECK | +| public | achievement_types | null | CHECK | +| realtime | messages | null | CHECK | +| auth | one_time_tokens | null | CHECK | +| auth | mfa_challenges | null | CHECK | +| public | teachers | null | CHECK | +| auth | mfa_amr_claims | null | CHECK | +| public | teacher_invites | null | CHECK | +| storage | s3_multipart_uploads_parts | null | CHECK | +| public | teachers | null | CHECK | +| public | phonics_categories | null | CHECK | +| public | story_settings | null | CHECK | +| public | schools | null | CHECK | +| realtime | subscription | null | CHECK | +| public | story_recordings | null | CHECK | +| public | stories | null | CHECK | +| public | story_pages | null | CHECK | +| auth | identities | null | CHECK | +| public | interests | null | CHECK | +| auth | flow_state | null | CHECK | +| auth | one_time_tokens | null | CHECK | +| public | teacher_invites | null | CHECK | +| auth | schema_migrations | null | CHECK | +| auth | mfa_challenges | null | CHECK | +| public | student_phonics_attempts | null | CHECK | +| public | story_settings | null | CHECK | +| public | teachers | null | CHECK | +| pgsodium | key | null | CHECK | +| public | interests | null | CHECK | +| auth | instances | null | CHECK | +| public | schools | null | CHECK | +| public | student_phonics_achievements | null | CHECK | +| storage | migrations | null | CHECK | +| public | classes | null | CHECK | +| public | story_exercise_words | null | CHECK | +| public | phonics_word_audio | null | CHECK | +| public | media_types | null | CHECK | +| public | languages | null | CHECK | +| public | story_themes | null | CHECK | +| auth | one_time_tokens | null | CHECK | +| auth | one_time_tokens | null | CHECK | +| realtime | messages | null | CHECK | +| realtime | messages | null | CHECK | +| public | story_characters | null | CHECK | +| public | story_subjects | null | CHECK | +| storage | s3_multipart_uploads_parts | null | CHECK | +| auth | sso_domains | null | CHECK | +| storage | s3_multipart_uploads_parts | null | CHECK | +| public | teacher_invites | null | CHECK | +| public | students | null | CHECK | +| auth | saml_relay_states | null | CHECK | +| public | stories | null | CHECK | +| public | story_settings | null | CHECK | +| public | story_exercise_words | null | CHECK | +| auth | mfa_challenges | null | CHECK | +| auth | one_time_tokens | null | CHECK | +| auth | saml_providers | null | CHECK | +| public | story_recordings | null | CHECK | +| public | phonics_words | null | CHECK | +| public | classes | null | CHECK | +| public | phonics_achievements | null | CHECK | +| public | phonics_exercises | null | CHECK | +| public | story_pages | null | CHECK | +| public | student_phonics_progress | null | CHECK | +| auth | saml_providers | null | CHECK | +| realtime | subscription | null | CHECK | +| public | story_subjects | null | CHECK | +| auth | sso_providers | null | CHECK | +| public | media_types | null | CHECK | +| storage | s3_multipart_uploads | null | CHECK | +| auth | one_time_tokens | null | CHECK | +| public | story_generations | null | CHECK | +| auth | saml_relay_states | null | CHECK | +| public | story_themes | null | CHECK | +| storage | buckets | null | CHECK | +| storage | s3_multipart_uploads_parts | null | CHECK | +| vault | secrets | null | CHECK | +| public | teacher_classes | null | CHECK | +| public | phonics_categories | null | CHECK | +| auth | mfa_factors | null | CHECK | +| auth | audit_log_entries | null | CHECK | +| auth | mfa_factors | null | CHECK | +| public | classes | null | CHECK | +| auth | saml_providers | null | CHECK | +| public | story_subjects | null | CHECK | +| public | story_settings | null | CHECK | +| public | phonics_categories | null | CHECK | +| public | story_subjects | null | CHECK | +| auth | flow_state | null | CHECK | +| public | student_phonics_attempts | null | CHECK | +| public | story_generations | null | CHECK | +| public | phonics_exercises | null | CHECK | +| auth | sso_domains | null | CHECK | +| storage | s3_multipart_uploads | null | CHECK | +| public | schools | null | CHECK | +| auth | users | null | CHECK | +| public | interests | null | CHECK | +| realtime | messages | null | CHECK | +| public | phonics_exercise_types | null | CHECK | +| public | story_exercise_words | null | CHECK | +| auth | audit_log_entries | null | CHECK | +| public | story_characters | null | CHECK | +| public | student_achievements_old | null | CHECK | +| net | http_request_queue | null | CHECK | +| auth | saml_providers | null | CHECK | +| storage | s3_multipart_uploads | null | CHECK | +| supabase_migrations | seed_files | null | CHECK | +| public | phonics_achievements | null | CHECK | +| public | story_pages | null | CHECK | +| public | phonics_exercises | null | CHECK | +| storage | objects | null | CHECK | +| public | student_phonics_attempt_answers | null | CHECK | +| storage | migrations | null | CHECK | +| auth | sso_domains | null | CHECK | +| public | story_recordings | null | CHECK | +| public | classes | null | CHECK | +| net | _http_response | null | CHECK | +| realtime | subscription | null | CHECK | +| public | teacher_invites | null | CHECK | +| auth | sessions | null | CHECK | +| public | phonics_exercise_media | null | CHECK | +| public | schools | null | CHECK | +| net | http_request_queue | null | CHECK | +| public | classes | null | CHECK | +| auth | sso_providers | null | CHECK | +| public | story_subjects | null | CHECK | +| auth | one_time_tokens | null | CHECK | +| public | story_recordings | null | CHECK | +| public | students | null | CHECK | +| realtime | subscription | null | CHECK | +| public | story_recordings | null | CHECK | +| net | http_request_queue | null | CHECK | +| auth | identities | null | CHECK | +| storage | s3_multipart_uploads | null | CHECK | +| public | story_themes | null | CHECK | +| auth | saml_relay_states | null | CHECK | +| public | teacher_invites | null | CHECK | +| auth | mfa_factors | null | CHECK | +| auth | identities | null | CHECK | +| public | stories | null | CHECK | +| public | story_pages | null | CHECK | +| vault | secrets | null | CHECK | +| vault | secrets | null | CHECK | +| public | achievement_types | null | CHECK | +| auth | saml_relay_states | null | CHECK | +| public | classes | null | CHECK | +| public | interests | null | CHECK | +| supabase_migrations | schema_migrations | null | CHECK | +| public | stories | null | CHECK | +| public | phonics_exercise_media | null | CHECK | +| auth | mfa_challenges | null | CHECK | +| public | story_characters | null | CHECK | +| storage | s3_multipart_uploads_parts | null | CHECK | +| public | languages | null | CHECK | +| public | teachers | null | CHECK | +| public | teachers | null | CHECK | +| storage | buckets | null | CHECK | +| public | story_settings | null | CHECK | +| public | interests | null | CHECK | +| public | languages | null | CHECK | +| auth | sessions | null | CHECK | +| public | story_pages | null | CHECK | +| net | http_request_queue | null | CHECK | +| auth | saml_providers | null | CHECK | +| public | teacher_classes | null | CHECK | +| public | story_generations | null | CHECK | +| auth | flow_state | null | CHECK | +| public | story_characters | null | CHECK | +| storage | s3_multipart_uploads_parts | null | CHECK | +| public | student_achievements | null | CHECK | +| public | students | null | CHECK | +| public | story_generations | null | CHECK | +| auth | one_time_tokens | null | CHECK | +| net | http_request_queue | null | CHECK | +| auth | mfa_factors | null | CHECK | +| storage | s3_multipart_uploads_parts | null | CHECK | +| public | teacher_classes | null | CHECK | \ No newline at end of file diff --git a/supabase/contexts/full_schema.md b/supabase/contexts/full_schema.md index a951c32..fd6e615 100644 --- a/supabase/contexts/full_schema.md +++ b/supabase/contexts/full_schema.md @@ -1,646 +1,647 @@ | table_schema | table_name | column_name | data_type | is_nullable | column_default | | ------------------- | ------------------------------- | --------------------------- | --------------------------- | ----------- | -------------------------------------------------- | -| realtime | subscription | id | bigint | NO | | -| realtime | schema_migrations | inserted_at | timestamp without time zone | YES | | -| public | stories | student_id | uuid | NO | | -| storage | s3_multipart_uploads | upload_signature | text | NO | | -| pgsodium | decrypted_key | key_context | bytea | YES | | -| pgsodium | valid_key | associated_data | text | YES | | -| pgsodium | key | status | USER-DEFINED | YES | 'valid'::pgsodium.key_status | -| auth | audit_log_entries | id | uuid | NO | | -| public | achievement_types | name | character varying | NO | | -| public | student_phonics_attempt_answers | answer_text | text | YES | | -| public | phonics_categories | id | uuid | NO | uuid_generate_v4() | -| public | phonics_exercise_media | order_index | integer | YES | | -| public | phonics_exercise_words | word_id | uuid | YES | | -| storage | migrations | name | character varying | NO | | -| net | _http_response | id | bigint | YES | | -| auth | identities | provider | text | NO | | -| extensions | pg_stat_statements | mean_exec_time | double precision | YES | | -| auth | mfa_factors | secret | text | YES | | -| auth | users | last_sign_in_at | timestamp with time zone | YES | | -| storage | objects | owner_id | text | YES | | -| vault | decrypted_secrets | nonce | bytea | YES | | -| auth | users | phone_confirmed_at | timestamp with time zone | YES | | -| extensions | pg_stat_statements | local_blks_hit | bigint | YES | | -| pgsodium | valid_key | created | timestamp with time zone | YES | | -| public | interests | id | uuid | NO | gen_random_uuid() | -| pgsodium | decrypted_key | associated_data | text | YES | | -| public | phonics_exercises | difficulty_level | integer | NO | | -| realtime | messages | topic | text | NO | | -| supabase_migrations | schema_migrations | statements | ARRAY | YES | | -| public | schools | address | text | YES | | -| auth | sessions | refreshed_at | timestamp without time zone | YES | | -| public | students | nickname | character varying | YES | | -| extensions | pg_stat_statements | queryid | bigint | YES | | -| auth | users | role | character varying | YES | | -| public | story_details | setting_title | text | YES | | -| public | student_phonics_progress | last_score | double precision | YES | 0 | -| public | phonics_exercise_types | id | uuid | NO | uuid_generate_v4() | -| auth | mfa_amr_claims | id | uuid | NO | | -| public | stories | subject_id | uuid | YES | | -| public | stories | setting_id | uuid | YES | | -| pgsodium | key | raw_key | bytea | YES | | -| pgsodium | key | parent_key | uuid | YES | | -| public | teacher_invites | email | text | NO | | -| vault | decrypted_secrets | updated_at | timestamp with time zone | YES | | -| extensions | pg_stat_statements | jit_functions | bigint | YES | | -| realtime | subscription | created_at | timestamp without time zone | NO | timezone('utc'::text, now()) | -| storage | s3_multipart_uploads_parts | created_at | timestamp with time zone | NO | now() | -| realtime | messages | private | boolean | YES | false | -| auth | users | phone | text | YES | NULL::character varying | -| public | schools | updated_at | timestamp with time zone | NO | timezone('utc'::text, now()) | -| auth | saml_providers | attribute_mapping | jsonb | YES | | -| extensions | pg_stat_statements | shared_blks_written | bigint | YES | | -| public | phonics_achievements | created_at | timestamp with time zone | YES | CURRENT_TIMESTAMP | -| public | students | school_id | uuid | NO | | -| public | interests | item | text | NO | | -| pgsodium | valid_key | status | USER-DEFINED | YES | | -| storage | s3_multipart_uploads | user_metadata | jsonb | YES | | -| public | story_themes | slug | text | NO | | -| vault | secrets | nonce | bytea | YES | pgsodium.crypto_aead_det_noncegen() | -| storage | objects | user_metadata | jsonb | YES | | -| storage | objects | version | text | YES | | -| public | teacher_invites | status | text | YES | 'pending'::text | -| public | story_subjects | active | boolean | YES | true | -| pgsodium | decrypted_key | comment | text | YES | | -| net | http_request_queue | method | text | NO | | -| extensions | pg_stat_statements | userid | oid | YES | | -| auth | users | instance_id | uuid | YES | | -| public | phonics_exercise_types | created_at | timestamp with time zone | YES | CURRENT_TIMESTAMP | -| public | students | avatar_settings | jsonb | YES | | -| realtime | subscription | claims | jsonb | NO | | -| realtime | messages | inserted_at | timestamp without time zone | NO | now() | -| public | phonics_categories | level | integer | NO | | -| public | story_characters | slug | text | NO | | -| storage | objects | bucket_id | text | YES | | -| public | students | birth_date | date | YES | | -| auth | refresh_tokens | revoked | boolean | YES | | -| storage | s3_multipart_uploads | owner_id | text | YES | | -| public | teachers | updated_at | timestamp with time zone | NO | timezone('utc'::text, now()) | -| pgsodium | decrypted_key | created | timestamp with time zone | YES | | -| public | achievements | name | text | YES | | -| storage | s3_multipart_uploads_parts | upload_id | text | NO | | -| auth | flow_state | provider_refresh_token | text | YES | | -| public | student_phonics_achievements | achievement_id | uuid | YES | | -| vault | decrypted_secrets | description | text | YES | | -| public | classes | period | text | YES | | -| pgsodium | key | raw_key_nonce | bytea | YES | | -| public | phonics_words | created_at | timestamp with time zone | YES | CURRENT_TIMESTAMP | -| public | teacher_invites | expires_at | timestamp with time zone | NO | | -| auth | identities | provider_id | text | NO | | -| public | languages | name | character varying | NO | | -| net | _http_response | headers | jsonb | YES | | -| auth | mfa_challenges | otp_code | text | YES | | -| public | stories | character_id | uuid | YES | | -| public | story_settings | updated_at | timestamp with time zone | NO | timezone('utc'::text, now()) | -| auth | flow_state | provider_type | text | NO | | -| public | teacher_invites | name | text | NO | | -| public | classes | updated_at | timestamp with time zone | NO | timezone('utc'::text, now()) | -| public | story_exercise_words | phonemes | ARRAY | YES | | -| public | story_settings | active | boolean | YES | true | -| public | story_generations | model_used | text | NO | | -| extensions | pg_stat_statements | toplevel | boolean | YES | | -| auth | users | aud | character varying | YES | | -| realtime | messages | extension | text | NO | | -| public | schools | phone | text | YES | | -| extensions | pg_stat_statements_info | dealloc | bigint | YES | | -| public | teachers | subject | text | YES | | -| pgsodium | masking_rule | priority | integer | YES | | -| extensions | pg_stat_statements | jit_emission_time | double precision | YES | | -| pgsodium | valid_key | id | uuid | YES | | -| vault | secrets | updated_at | timestamp with time zone | NO | CURRENT_TIMESTAMP | -| public | story_details | subject_title | text | YES | | -| auth | users | is_anonymous | boolean | NO | false | -| public | story_subjects | updated_at | timestamp with time zone | NO | timezone('utc'::text, now()) | -| public | students | accessibility_settings | jsonb | YES | | -| extensions | pg_stat_statements | wal_bytes | numeric | YES | | -| public | story_recordings | analysis | jsonb | YES | | -| public | student_phonics_achievements | id | uuid | NO | uuid_generate_v4() | -| vault | decrypted_secrets | id | uuid | YES | | -| auth | identities | identity_data | jsonb | NO | | -| net | _http_response | error_msg | text | YES | | -| auth | instances | uuid | uuid | YES | | -| auth | saml_providers | updated_at | timestamp with time zone | YES | | -| public | phonics_categories | updated_at | timestamp with time zone | YES | CURRENT_TIMESTAMP | -| public | phonics_exercise_words | is_correct_answer | boolean | YES | false | -| realtime | subscription | entity | regclass | NO | | -| public | student_achievements | student_id | uuid | YES | | -| auth | users | email_change | character varying | YES | | -| pgsodium | masking_rule | attname | name | YES | | -| storage | s3_multipart_uploads | bucket_id | text | NO | | -| extensions | pg_stat_statements | min_exec_time | double precision | YES | | -| public | story_pages | image_path_thumb | text | YES | | -| public | phonics_achievements | icon_url | text | YES | | -| pgsodium | decrypted_key | id | uuid | YES | | -| auth | identities | updated_at | timestamp with time zone | YES | | -| storage | buckets | owner_id | text | YES | | -| public | story_pages | story_id | uuid | YES | | -| extensions | pg_stat_statements | max_plan_time | double precision | YES | | -| net | _http_response | content_type | text | YES | | -| auth | users | confirmation_token | character varying | YES | | -| public | student_phonics_progress | completed_at | timestamp with time zone | YES | | -| public | student_phonics_achievements | earned_at | timestamp with time zone | YES | CURRENT_TIMESTAMP | -| auth | saml_relay_states | sso_provider_id | uuid | NO | | -| public | students | uppercase_text_preferences | boolean | YES | false | -| vault | decrypted_secrets | secret | text | YES | | -| pgsodium | decrypted_key | expires | timestamp with time zone | YES | | -| storage | s3_multipart_uploads | id | text | NO | | -| auth | one_time_tokens | relates_to | text | NO | | -| public | phonics_categories | description | text | YES | | -| auth | sessions | aal | USER-DEFINED | YES | | -| public | story_details | theme_title | text | YES | | -| pgsodium | mask_columns | nonce_column | text | YES | | -| public | phonics_word_audio | created_at | timestamp with time zone | YES | timezone('utc'::text, now()) | -| public | phonics_exercise_words | id | uuid | NO | uuid_generate_v4() | -| public | phonics_exercises | instructions | text | NO | | -| auth | identities | id | uuid | NO | gen_random_uuid() | -| public | phonics_exercise_types | description | text | YES | | -| auth | mfa_factors | created_at | timestamp with time zone | NO | | -| extensions | pg_stat_statements | total_plan_time | double precision | YES | | -| auth | users | email_confirmed_at | timestamp with time zone | YES | | -| public | student_achievements_old | student_id | uuid | YES | | -| public | teacher_invites | id | uuid | NO | uuid_generate_v4() | -| public | story_pages | image_path_medium | text | YES | | -| public | story_pages | image_url_large | text | YES | | -| pgsodium | valid_key | key_type | USER-DEFINED | YES | | -| storage | buckets | name | text | NO | | -| public | interests | category | text | NO | | -| public | story_details | status | text | YES | | -| public | schools | id | uuid | NO | uuid_generate_v4() | -| public | student_phonics_attempts | time_spent_seconds | integer | YES | | -| pgsodium | masking_rule | associated_columns | text | YES | | -| auth | sessions | updated_at | timestamp with time zone | YES | | -| pgsodium | masking_rule | view_name | text | YES | | -| public | phonics_exercise_media | created_at | timestamp with time zone | YES | CURRENT_TIMESTAMP | -| public | story_generations | story_id | uuid | YES | | -| public | media_types | name | character varying | NO | | -| public | phonics_exercises | points | integer | YES | 10 | -| pgsodium | mask_columns | key_id_column | text | YES | | -| public | phonics_achievements | id | uuid | NO | uuid_generate_v4() | -| pgsodium | decrypted_key | key_id | bigint | YES | | -| public | story_recordings | error_count | integer | YES | | -| public | story_exercise_words | story_id | uuid | YES | | -| public | story_details | setting_id | uuid | YES | | -| public | classes | name | text | NO | | -| vault | decrypted_secrets | key_id | uuid | YES | | -| public | story_recordings | id | uuid | NO | uuid_generate_v4() | -| auth | users | invited_at | timestamp with time zone | YES | | -| auth | mfa_challenges | created_at | timestamp with time zone | NO | | -| public | student_phonics_progress | stars | integer | YES | 0 | -| extensions | pg_stat_statements | min_plan_time | double precision | YES | | -| auth | saml_providers | entity_id | text | NO | | -| public | story_details | character_title | text | YES | | -| public | phonics_exercises | estimated_time_seconds | integer | YES | | -| auth | instances | updated_at | timestamp with time zone | YES | | -| pgsodium | valid_key | key_context | bytea | YES | | -| public | teachers | id | uuid | NO | uuid_generate_v4() | -| public | students | notification_preferences | jsonb | YES | | -| pgsodium | masking_rule | attnum | integer | YES | | -| public | story_subjects | title | text | NO | | -| extensions | pg_stat_statements | blk_write_time | double precision | YES | | -| vault | secrets | description | text | NO | ''::text | -| auth | users | banned_until | timestamp with time zone | YES | | -| auth | flow_state | id | uuid | NO | | -| auth | mfa_factors | factor_type | USER-DEFINED | NO | | -| auth | identities | email | text | YES | | -| auth | users | email_change_token_current | character varying | YES | ''::character varying | -| public | student_phonics_progress | completed | boolean | YES | false | -| public | student_achievements | metadata | jsonb | YES | | -| extensions | pg_stat_statements | temp_blks_written | bigint | YES | | -| public | story_settings | id | uuid | NO | uuid_generate_v4() | -| public | story_details | character_id | uuid | YES | | -| public | teachers | email | text | NO | | -| auth | saml_relay_states | redirect_to | text | YES | | -| public | story_details | context | text | YES | | -| public | story_pages | image_url | text | NO | | -| public | schools | created_at | timestamp with time zone | NO | timezone('utc'::text, now()) | -| auth | saml_providers | created_at | timestamp with time zone | YES | | -| realtime | messages | event | text | YES | | -| public | story_details | character_icon | text | YES | | -| public | phonics_exercises | type_id | uuid | YES | | -| pgsodium | masking_rule | nonce_column | text | YES | | -| public | story_settings | description | text | NO | | -| auth | one_time_tokens | user_id | uuid | NO | | -| public | student_phonics_progress | exercise_id | uuid | YES | | -| auth | mfa_factors | id | uuid | NO | | -| public | students | language | USER-DEFINED | YES | 'pt-BR'::language_enum | -| public | phonics_word_audio | word | text | NO | | -| net | _http_response | created | timestamp with time zone | NO | now() | -| public | teacher_invites | message | text | YES | | -| public | classes | teacher_id | uuid | YES | | -| public | story_subjects | created_at | timestamp with time zone | NO | timezone('utc'::text, now()) | -| vault | secrets | created_at | timestamp with time zone | NO | CURRENT_TIMESTAMP | -| auth | flow_state | code_challenge_method | USER-DEFINED | NO | | -| public | story_recordings | fluency_score | integer | YES | | -| auth | sso_domains | domain | text | NO | | -| auth | sso_providers | resource_id | text | YES | | -| storage | s3_multipart_uploads | version | text | NO | | -| public | student_phonics_progress | correct_answers_count | integer | YES | 0 | -| public | phonics_achievements | description | text | YES | | -| public | student_achievements_old | metadata | jsonb | YES | | -| auth | saml_providers | name_id_format | text | YES | | -| public | phonics_exercise_words | created_at | timestamp with time zone | YES | CURRENT_TIMESTAMP | -| public | story_pages | image_path_large | text | YES | | -| pgsodium | mask_columns | attname | name | YES | | -| public | phonics_exercise_media | media_type_id | uuid | YES | | -| auth | sessions | id | uuid | NO | | -| public | story_recordings | self_corrections | integer | YES | | -| public | story_details | student_id | uuid | YES | | -| auth | mfa_challenges | web_authn_session_data | jsonb | YES | | -| public | student_phonics_attempts | student_id | uuid | YES | | -| public | classes | created_at | timestamp with time zone | NO | timezone('utc'::text, now()) | -| storage | buckets | updated_at | timestamp with time zone | YES | now() | -| public | story_recordings | audio_url | text | YES | | -| auth | audit_log_entries | ip_address | character varying | NO | ''::character varying | -| public | student_phonics_attempt_answers | attempt_id | uuid | YES | | -| pgsodium | key | key_type | USER-DEFINED | YES | | -| auth | mfa_factors | friendly_name | text | YES | | -| public | student_phonics_progress | id | uuid | NO | uuid_generate_v4() | -| public | story_settings | created_at | timestamp with time zone | NO | timezone('utc'::text, now()) | -| public | story_subjects | description | text | NO | | -| public | stories | content | jsonb | NO | | -| vault | secrets | secret | text | NO | | -| auth | flow_state | provider_access_token | text | YES | | -| public | interests | updated_at | timestamp with time zone | NO | timezone('utc'::text, now()) | -| public | teachers | created_at | timestamp with time zone | NO | timezone('utc'::text, now()) | -| storage | s3_multipart_uploads | created_at | timestamp with time zone | NO | now() | -| supabase_migrations | seed_files | hash | text | NO | | -| realtime | subscription | claims_role | regrole | NO | | -| auth | saml_providers | metadata_xml | text | NO | | -| public | phonics_exercises | id | uuid | NO | uuid_generate_v4() | -| auth | mfa_challenges | verified_at | timestamp with time zone | YES | | -| pgsodium | key | comment | text | YES | | -| net | _http_response | timed_out | boolean | YES | | -| public | story_recordings | created_at | timestamp with time zone | NO | now() | -| public | classes | grade | text | NO | | -| public | teacher_invites | token | text | NO | | -| public | stories | context | text | YES | | -| auth | flow_state | created_at | timestamp with time zone | YES | | -| auth | sso_domains | id | uuid | NO | | -| public | phonics_achievements | required_count | integer | YES | 1 | -| public | students | dark_mode | boolean | YES | false | -| public | teachers | status | text | YES | 'pending'::text | -| pgsodium | mask_columns | key_id | text | YES | | -| public | phonics_exercise_media | id | uuid | NO | uuid_generate_v4() | -| public | story_details | setting_icon | text | YES | | -| public | schools | director_name | text | NO | 'Não informado'::text | -| auth | sessions | created_at | timestamp with time zone | YES | | -| public | phonics_categories | created_at | timestamp with time zone | YES | CURRENT_TIMESTAMP | -| auth | mfa_amr_claims | created_at | timestamp with time zone | NO | | -| realtime | messages | updated_at | timestamp without time zone | NO | now() | -| public | classes | id | uuid | NO | uuid_generate_v4() | -| public | story_recordings | student_id | uuid | YES | | -| public | student_phonics_progress | last_attempt_at | timestamp with time zone | YES | | -| auth | mfa_factors | phone | text | YES | | -| auth | mfa_challenges | id | uuid | NO | | -| auth | identities | created_at | timestamp with time zone | YES | | -| public | students | updated_at | timestamp with time zone | NO | timezone('utc'::text, now()) | -| public | students | status | text | NO | 'active'::text | -| public | teacher_classes | teacher_id | uuid | NO | | -| extensions | pg_stat_statements | jit_emission_count | bigint | YES | | -| pgsodium | mask_columns | format_type | text | YES | | -| auth | sessions | not_after | timestamp with time zone | YES | | -| public | phonics_exercise_media | url | text | NO | | -| net | http_request_queue | body | bytea | YES | | -| public | story_themes | icon | text | NO | | -| public | phonics_achievements | name | character varying | NO | | -| auth | sso_domains | created_at | timestamp with time zone | YES | | -| public | students | preferred_themes | ARRAY | YES | | -| pgsodium | valid_key | expires | timestamp with time zone | YES | | -| public | story_subjects | id | uuid | NO | uuid_generate_v4() | -| public | students | class_id | uuid | NO | | -| vault | secrets | id | uuid | NO | gen_random_uuid() | -| extensions | pg_stat_statements | jit_optimization_time | double precision | YES | | -| vault | decrypted_secrets | created_at | timestamp with time zone | YES | | -| auth | refresh_tokens | id | bigint | NO | nextval('auth.refresh_tokens_id_seq'::regclass) | -| auth | flow_state | auth_code | text | NO | | -| auth | users | encrypted_password | character varying | YES | | -| public | student_phonics_progress | attempts | integer | YES | 0 | -| extensions | pg_stat_statements | plans | bigint | YES | | -| auth | mfa_factors | updated_at | timestamp with time zone | NO | | -| public | story_characters | icon | text | NO | | -| storage | objects | created_at | timestamp with time zone | YES | now() | -| auth | users | email_change_confirm_status | smallint | YES | 0 | -| public | story_settings | title | text | NO | | -| extensions | pg_stat_statements | blk_read_time | double precision | YES | | -| public | phonics_exercises | title | character varying | NO | | -| auth | saml_providers | id | uuid | NO | | -| public | languages | flag_icon | character varying | YES | | -| auth | sessions | user_agent | text | YES | | -| public | story_recordings | processed_at | timestamp with time zone | YES | | -| storage | s3_multipart_uploads_parts | bucket_id | text | NO | | -| pgsodium | decrypted_key | name | text | YES | | -| public | teachers | name | text | NO | | -| public | phonics_words | word | character varying | NO | | -| auth | sso_providers | created_at | timestamp with time zone | YES | | -| storage | buckets | file_size_limit | bigint | YES | | -| auth | sso_domains | sso_provider_id | uuid | NO | | -| public | stories | status | text | YES | 'draft'::text | -| public | story_exercise_words | created_at | timestamp with time zone | YES | now() | -| public | student_phonics_progress | xp_earned | integer | YES | 0 | -| public | student_phonics_progress | updated_at | timestamp with time zone | YES | CURRENT_TIMESTAMP | -| public | story_generations | language_type | USER-DEFINED | NO | 'pt-BR'::language_enum | -| public | phonics_exercise_media | exercise_id | uuid | YES | | -| pgsodium | key | key_id | bigint | YES | nextval('pgsodium.key_key_id_seq'::regclass) | -| auth | mfa_amr_claims | session_id | uuid | NO | | +| storage | s3_multipart_uploads | user_metadata | jsonb | YES | null | +| realtime | schema_migrations | inserted_at | timestamp without time zone | YES | null | +| extensions | pg_stat_statements_info | dealloc | bigint | YES | null | +| extensions | pg_stat_statements_info | stats_reset | timestamp with time zone | YES | null | +| extensions | pg_stat_statements | userid | oid | YES | null | +| extensions | pg_stat_statements | dbid | oid | YES | null | +| extensions | pg_stat_statements | toplevel | boolean | YES | null | +| extensions | pg_stat_statements | queryid | bigint | YES | null | +| public | teacher_classes | teacher_id | uuid | NO | null | +| public | teacher_classes | class_id | uuid | NO | null | | public | teacher_classes | created_at | timestamp with time zone | NO | timezone('utc'::text, now()) | -| public | story_details | title | text | YES | | -| public | student_phonics_attempts | exercise_id | uuid | YES | | -| public | story_recordings | improvements | ARRAY | YES | | -| pgsodium | masking_rule | key_id | text | YES | | -| public | students | preferred_font_size | integer | YES | 16 | -| public | story_recordings | suggestions | text | YES | | -| public | interests | created_at | timestamp with time zone | NO | timezone('utc'::text, now()) | -| public | phonics_exercises | is_active | boolean | YES | true | -| public | phonics_exercises | created_at | timestamp with time zone | YES | CURRENT_TIMESTAMP | -| public | phonics_words | syllables_count | integer | NO | | -| public | story_details | theme_icon | text | YES | | -| supabase_migrations | seed_files | path | text | NO | | -| extensions | pg_stat_statements | jit_optimization_count | bigint | YES | | -| public | phonics_exercises | category_id | uuid | YES | | -| net | _http_response | content | text | YES | | -| public | students | last_active_at | timestamp with time zone | YES | | -| public | story_pages | image_url_thumb | text | YES | | -| public | student_phonics_attempt_answers | id | uuid | NO | uuid_generate_v4() | -| public | phonics_categories | order_index | integer | NO | | -| auth | one_time_tokens | token_type | USER-DEFINED | NO | | -| public | student_phonics_progress | student_id | uuid | YES | | -| public | phonics_word_audio | audio_url | text | NO | | -| pgsodium | masking_rule | col_description | text | YES | | -| auth | refresh_tokens | user_id | character varying | YES | | -| auth | saml_relay_states | updated_at | timestamp with time zone | YES | | -| extensions | pg_stat_statements | max_exec_time | double precision | YES | | -| public | students | email | text | NO | | -| auth | users | email_change_sent_at | timestamp with time zone | YES | | -| auth | saml_providers | sso_provider_id | uuid | NO | | -| auth | identities | last_sign_in_at | timestamp with time zone | YES | | -| auth | users | email_change_token_new | character varying | YES | | -| extensions | pg_stat_statements | total_exec_time | double precision | YES | | -| public | student_phonics_progress | created_at | timestamp with time zone | YES | CURRENT_TIMESTAMP | -| public | students | reading_goals | jsonb | YES | | -| public | phonics_words | id | uuid | NO | uuid_generate_v4() | -| public | story_subjects | slug | text | NO | | | public | students | id | uuid | NO | uuid_generate_v4() | -| pgsodium | masking_rule | relnamespace | regnamespace | YES | | -| vault | secrets | name | text | YES | | -| public | phonics_exercises | required_score | double precision | YES | 0.7 | -| public | story_themes | active | boolean | YES | true | -| auth | refresh_tokens | instance_id | uuid | YES | | -| public | story_details | subject_id | uuid | YES | | -| net | http_request_queue | timeout_milliseconds | integer | NO | | -| auth | one_time_tokens | updated_at | timestamp without time zone | NO | now() | -| public | student_phonics_attempt_answers | is_correct | boolean | NO | | -| storage | objects | updated_at | timestamp with time zone | YES | now() | -| public | story_characters | active | boolean | YES | true | -| public | story_generations | original_prompt | text | NO | | -| public | teacher_classes | id | uuid | NO | uuid_generate_v4() | -| auth | mfa_amr_claims | authentication_method | text | NO | | -| public | media_types | description | text | YES | | -| auth | users | email | character varying | YES | | -| extensions | pg_stat_statements | query | text | YES | | -| pgsodium | masking_rule | security_invoker | boolean | YES | | -| public | story_exercise_words | word | text | NO | | -| extensions | pg_stat_statements | shared_blks_dirtied | bigint | YES | | -| auth | users | updated_at | timestamp with time zone | YES | | -| public | story_recordings | words_per_minute | integer | YES | | -| public | classes | school_id | uuid | NO | | -| storage | s3_multipart_uploads_parts | key | text | NO | | -| public | story_details | updated_at | timestamp with time zone | YES | | -| auth | mfa_challenges | factor_id | uuid | NO | | -| public | languages | created_at | timestamp with time zone | NO | timezone('utc'::text, now()) | -| pgsodium | masking_rule | attrelid | oid | YES | | -| public | students | name | text | NO | | -| storage | s3_multipart_uploads_parts | owner_id | text | YES | | -| pgsodium | decrypted_key | key_type | USER-DEFINED | YES | | -| auth | flow_state | user_id | uuid | YES | | -| auth | refresh_tokens | token | character varying | YES | | -| public | story_details | subject_icon | text | YES | | -| auth | schema_migrations | version | character varying | NO | | -| public | phonics_word_audio | audio_path | text | NO | | -| public | story_settings | slug | text | NO | | -| auth | one_time_tokens | token_hash | text | NO | | -| public | story_recordings | transcription | text | YES | | -| storage | objects | metadata | jsonb | YES | | -| public | story_characters | updated_at | timestamp with time zone | NO | timezone('utc'::text, now()) | -| auth | mfa_factors | web_authn_credential | jsonb | YES | | -| public | phonics_words | phonetic_transcription | character varying | YES | | -| public | teachers | school_id | uuid | NO | | -| vault | decrypted_secrets | decrypted_secret | text | YES | | -| public | story_recordings | accuracy_score | integer | YES | | -| public | story_themes | updated_at | timestamp with time zone | NO | timezone('utc'::text, now()) | -| public | story_recordings | story_id | uuid | YES | | -| auth | sessions | tag | text | YES | | -| pgsodium | decrypted_key | parent_key | uuid | YES | | -| pgsodium | valid_key | key_id | bigint | YES | | -| extensions | pg_stat_statements | jit_generation_time | double precision | YES | | -| public | student_phonics_attempts | score | double precision | NO | | -| auth | users | is_super_admin | boolean | YES | | -| public | story_details | content | jsonb | YES | | -| public | teachers | class_ids | ARRAY | YES | | -| extensions | pg_stat_statements | shared_blks_hit | bigint | YES | | -| public | story_generations | id | uuid | NO | uuid_generate_v4() | -| public | teacher_classes | class_id | uuid | NO | | -| auth | flow_state | auth_code_issued_at | timestamp with time zone | YES | | -| public | media_types | id | uuid | NO | uuid_generate_v4() | -| public | students | avatar_url | text | YES | | -| auth | flow_state | updated_at | timestamp with time zone | YES | | -| public | phonics_achievements | type_id | uuid | YES | | -| auth | sso_providers | updated_at | timestamp with time zone | YES | | -| public | story_exercise_words | id | uuid | NO | uuid_generate_v4() | -| public | story_details | id | uuid | YES | | -| public | schools | email | text | YES | | -| public | story_pages | created_at | timestamp with time zone | NO | timezone('utc'::text, now()) | -| extensions | pg_stat_statements | local_blks_read | bigint | YES | | -| public | student_phonics_attempts | id | uuid | NO | uuid_generate_v4() | -| auth | users | phone_change | text | YES | ''::character varying | -| realtime | messages | payload | jsonb | YES | | +| public | students | class_id | uuid | NO | null | +| public | students | birth_date | date | YES | null | | public | students | created_at | timestamp with time zone | NO | timezone('utc'::text, now()) | -| auth | refresh_tokens | session_id | uuid | YES | | -| public | story_exercise_words | exercise_type | text | NO | | -| auth | sso_providers | id | uuid | NO | | -| auth | mfa_factors | last_challenged_at | timestamp with time zone | YES | | -| public | teacher_invites | subject | text | YES | | -| auth | mfa_factors | web_authn_aaguid | uuid | YES | | -| public | media_types | created_at | timestamp with time zone | YES | CURRENT_TIMESTAMP | -| extensions | pg_stat_statements | temp_blk_write_time | double precision | YES | | -| pgsodium | mask_columns | attrelid | oid | YES | | -| auth | users | reauthentication_sent_at | timestamp with time zone | YES | | -| auth | sessions | user_id | uuid | NO | | -| public | story_generations | ai_response | text | NO | | -| auth | mfa_amr_claims | updated_at | timestamp with time zone | NO | | -| realtime | subscription | filters | ARRAY | NO | '{}'::realtime.user_defined_filter[] | -| public | student_phonics_attempt_answers | word_id | uuid | YES | | -| auth | one_time_tokens | id | uuid | NO | | -| public | phonics_exercise_words | order_index | integer | YES | | -| auth | mfa_factors | user_id | uuid | NO | | -| public | phonics_word_audio | id | uuid | NO | uuid_generate_v4() | -| public | students | guardian_phone | text | YES | | -| storage | s3_multipart_uploads | key | text | NO | | -| pgsodium | masking_rule | relname | name | YES | | -| auth | sessions | ip | inet | YES | | -| auth | refresh_tokens | updated_at | timestamp with time zone | YES | | -| public | story_recordings | pronunciation_score | integer | YES | | -| extensions | pg_stat_statements | jit_inlining_count | bigint | YES | | -| storage | buckets | public | boolean | YES | false | -| public | stories | updated_at | timestamp with time zone | NO | timezone('utc'::text, now()) | -| auth | flow_state | authentication_method | text | NO | | -| pgsodium | key | name | text | YES | | -| pgsodium | key | key_context | bytea | YES | '\x7067736f6469756d'::bytea | -| public | story_settings | icon | text | NO | | -| public | story_generations | created_at | timestamp with time zone | NO | timezone('utc'::text, now()) | -| public | story_characters | title | text | NO | | -| storage | objects | name | text | YES | | -| public | student_achievements | id | uuid | NO | uuid_generate_v4() | -| public | story_exercise_words | syllable_pattern | text | YES | | -| auth | flow_state | code_challenge | text | NO | | -| public | stories | created_at | timestamp with time zone | NO | timezone('utc'::text, now()) | -| pgsodium | decrypted_key | status | USER-DEFINED | YES | | -| public | achievements | description | text | YES | | -| public | students | guardian_email | text | YES | | -| storage | s3_multipart_uploads_parts | size | bigint | NO | 0 | -| auth | refresh_tokens | parent | character varying | YES | | -| auth | saml_relay_states | for_email | text | YES | | -| public | student_phonics_achievements | student_id | uuid | YES | | -| public | teachers | phone | text | YES | | -| vault | decrypted_secrets | name | text | YES | | -| public | languages | code | character varying | NO | | -| auth | instances | id | uuid | NO | | -| public | story_pages | text | text | NO | | -| pgsodium | key | associated_data | text | YES | 'associated'::text | -| extensions | pg_stat_statements | shared_blks_read | bigint | YES | | -| public | story_recordings | pause_count | integer | YES | | -| auth | users | created_at | timestamp with time zone | YES | | -| extensions | pg_stat_statements_info | stats_reset | timestamp with time zone | YES | | -| public | story_recordings | status | text | NO | 'pending_analysis'::text | -| public | stories | theme_id | uuid | YES | | -| storage | buckets | created_at | timestamp with time zone | YES | now() | -| pgsodium | valid_key | name | text | YES | | -| public | student_achievements_old | earned_at | timestamp with time zone | YES | now() | -| public | phonics_achievements | points | integer | YES | 0 | -| public | story_themes | title | text | NO | | -| pgsodium | masking_rule | format_type | text | YES | | -| net | http_request_queue | url | text | NO | | -| pgsodium | decrypted_key | raw_key_nonce | bytea | YES | | -| pgsodium | decrypted_key | raw_key | bytea | YES | | -| storage | buckets | id | text | NO | | -| supabase_migrations | schema_migrations | name | text | YES | | -| storage | objects | path_tokens | ARRAY | YES | | -| public | schools | name | text | NO | | -| pgsodium | mask_columns | associated_columns | text | YES | | -| auth | users | phone_change_sent_at | timestamp with time zone | YES | | -| extensions | pg_stat_statements | local_blks_written | bigint | YES | | -| public | stories | language_type | USER-DEFINED | NO | 'pt-BR'::language_enum | -| auth | one_time_tokens | created_at | timestamp without time zone | NO | now() | -| auth | sessions | factor_id | uuid | YES | | -| extensions | pg_stat_statements | local_blks_dirtied | bigint | YES | | -| auth | users | phone_change_token | character varying | YES | ''::character varying | -| storage | s3_multipart_uploads_parts | version | text | NO | | -| public | story_themes | created_at | timestamp with time zone | NO | timezone('utc'::text, now()) | -| public | student_achievements_old | id | uuid | NO | uuid_generate_v4() | -| pgsodium | key | user_data | text | YES | | -| public | teacher_invites | school_id | uuid | NO | | -| public | stories | title | text | NO | | -| storage | s3_multipart_uploads | in_progress_size | bigint | NO | 0 | -| pgsodium | key | created | timestamp with time zone | NO | CURRENT_TIMESTAMP | -| public | achievement_types | description | text | YES | | -| realtime | subscription | subscription_id | uuid | NO | | -| public | student_achievements | earned_at | timestamp with time zone | YES | now() | -| auth | audit_log_entries | payload | json | YES | | -| storage | objects | last_accessed_at | timestamp with time zone | YES | now() | -| public | phonics_exercise_words | exercise_id | uuid | YES | | -| public | teacher_invites | created_at | timestamp with time zone | NO | timezone('utc'::text, now()) | -| public | story_characters | created_at | timestamp with time zone | NO | timezone('utc'::text, now()) | -| auth | mfa_factors | status | USER-DEFINED | NO | | -| pgsodium | decrypted_key | decrypted_raw_key | bytea | YES | | -| auth | instances | created_at | timestamp with time zone | YES | | -| storage | migrations | hash | character varying | NO | | -| public | languages | updated_at | timestamp with time zone | NO | timezone('utc'::text, now()) | -| public | story_recordings | error_message | text | YES | | -| public | story_pages | id | uuid | NO | uuid_generate_v4() | -| public | student_phonics_attempts | created_at | timestamp with time zone | YES | CURRENT_TIMESTAMP | -| public | story_details | created_at | timestamp with time zone | YES | | -| extensions | pg_stat_statements | temp_blks_read | bigint | YES | | -| auth | saml_relay_states | id | uuid | NO | | -| storage | s3_multipart_uploads_parts | etag | text | NO | | -| auth | users | confirmed_at | timestamp with time zone | YES | | -| realtime | messages | id | uuid | NO | gen_random_uuid() | -| public | phonics_exercise_media | alt_text | text | YES | | -| net | http_request_queue | headers | jsonb | NO | | -| public | phonics_exercise_types | name | character varying | NO | | -| public | story_details | theme_id | uuid | YES | | -| public | student_phonics_attempt_answers | created_at | timestamp with time zone | YES | CURRENT_TIMESTAMP | -| public | phonics_exercises | updated_at | timestamp with time zone | YES | CURRENT_TIMESTAMP | -| public | story_recordings | strengths | ARRAY | YES | | -| auth | sso_domains | updated_at | timestamp with time zone | YES | | -| public | student_achievements_old | achievement_id | uuid | YES | | -| public | story_themes | description | text | NO | | -| auth | users | recovery_token | character varying | YES | | -| storage | buckets | owner | uuid | YES | | -| extensions | pg_stat_statements | stddev_plan_time | double precision | YES | | -| extensions | pg_stat_statements | jit_inlining_time | double precision | YES | | -| public | interests | student_id | uuid | NO | | -| supabase_migrations | schema_migrations | version | text | NO | | -| public | student_phonics_progress | total_time_spent_seconds | integer | YES | 0 | -| storage | migrations | id | integer | NO | | -| auth | users | reauthentication_token | character varying | YES | ''::character varying | -| public | story_pages | page_number | integer | NO | | -| extensions | pg_stat_statements | temp_blk_read_time | double precision | YES | | -| net | _http_response | status_code | integer | YES | | -| public | languages | instructions | text | YES | | -| public | phonics_exercises | description | text | YES | | -| auth | saml_relay_states | request_id | text | NO | | -| storage | s3_multipart_uploads_parts | part_number | integer | NO | | -| realtime | schema_migrations | version | bigint | NO | | +| public | students | updated_at | timestamp with time zone | NO | timezone('utc'::text, now()) | +| public | students | school_id | uuid | NO | null | +| public | students | preferred_font_size | integer | YES | 16 | +| public | students | dark_mode | boolean | YES | false | +| public | students | accessibility_settings | jsonb | YES | null | +| public | students | notification_preferences | jsonb | YES | null | +| public | students | avatar_settings | jsonb | YES | null | +| public | students | reading_goals | jsonb | YES | null | +| public | students | last_active_at | timestamp with time zone | YES | null | +| public | students | uppercase_text_preferences | boolean | YES | false | +| public | students | language | USER-DEFINED | YES | 'pt-BR'::language_enum | | public | stories | id | uuid | NO | uuid_generate_v4() | -| extensions | pg_stat_statements | wal_records | bigint | YES | | -| auth | users | is_sso_user | boolean | NO | false | -| pgsodium | key | id | uuid | NO | gen_random_uuid() | -| public | story_characters | description | text | NO | | -| storage | objects | owner | uuid | YES | | -| auth | audit_log_entries | instance_id | uuid | YES | | -| public | phonics_categories | name | character varying | NO | | -| public | achievement_types | id | uuid | NO | uuid_generate_v4() | -| auth | users | raw_app_meta_data | jsonb | YES | | -| extensions | pg_stat_statements | stddev_exec_time | double precision | YES | | -| public | student_phonics_progress | best_score | double precision | YES | 0 | -| auth | saml_relay_states | created_at | timestamp with time zone | YES | | -| public | achievements | id | uuid | NO | uuid_generate_v4() | -| pgsodium | masking_rule | key_id_column | text | YES | | -| storage | s3_multipart_uploads_parts | id | uuid | NO | gen_random_uuid() | -| auth | identities | user_id | uuid | NO | | -| public | languages | id | uuid | NO | uuid_generate_v4() | -| public | story_pages | image_path | text | YES | | -| auth | saml_providers | metadata_url | text | YES | | -| auth | instances | raw_base_config | text | YES | | -| storage | migrations | executed_at | timestamp without time zone | YES | CURRENT_TIMESTAMP | -| extensions | pg_stat_statements | rows | bigint | YES | | -| auth | users | raw_user_meta_data | jsonb | YES | | -| pgsodium | key | expires | timestamp with time zone | YES | | -| public | student_achievements | achievement_id | uuid | YES | | -| public | achievement_types | created_at | timestamp with time zone | YES | CURRENT_TIMESTAMP | -| storage | objects | id | uuid | NO | gen_random_uuid() | -| auth | audit_log_entries | created_at | timestamp with time zone | YES | | -| public | story_characters | id | uuid | NO | uuid_generate_v4() | -| vault | secrets | key_id | uuid | YES | (pgsodium.create_key()).id | -| auth | users | deleted_at | timestamp with time zone | YES | | -| public | story_subjects | icon | text | NO | | -| storage | buckets | allowed_mime_types | ARRAY | YES | | -| extensions | pg_stat_statements | wal_fpi | bigint | YES | | -| auth | users | recovery_sent_at | timestamp with time zone | YES | | -| extensions | pg_stat_statements | mean_plan_time | double precision | YES | | -| extensions | pg_stat_statements | calls | bigint | YES | | -| auth | users | confirmation_sent_at | timestamp with time zone | YES | | -| auth | refresh_tokens | created_at | timestamp with time zone | YES | | -| public | story_recordings | comprehension_score | integer | YES | | -| auth | saml_relay_states | flow_state_id | uuid | YES | | +| public | stories | student_id | uuid | NO | null | +| public | stories | content | jsonb | NO | null | +| public | stories | created_at | timestamp with time zone | NO | timezone('utc'::text, now()) | +| public | stories | updated_at | timestamp with time zone | NO | timezone('utc'::text, now()) | +| public | stories | theme_id | uuid | YES | null | +| public | stories | subject_id | uuid | YES | null | +| public | stories | character_id | uuid | YES | null | +| public | stories | setting_id | uuid | YES | null | +| public | stories | language_type | USER-DEFINED | NO | 'pt-BR'::language_enum | | public | story_themes | id | uuid | NO | uuid_generate_v4() | +| public | story_themes | active | boolean | YES | true | +| public | story_themes | created_at | timestamp with time zone | NO | timezone('utc'::text, now()) | +| public | story_themes | updated_at | timestamp with time zone | NO | timezone('utc'::text, now()) | +| public | story_subjects | id | uuid | NO | uuid_generate_v4() | +| public | story_subjects | active | boolean | YES | true | +| public | story_subjects | created_at | timestamp with time zone | NO | timezone('utc'::text, now()) | +| public | story_subjects | updated_at | timestamp with time zone | NO | timezone('utc'::text, now()) | +| public | story_characters | id | uuid | NO | uuid_generate_v4() | +| public | story_characters | active | boolean | YES | true | +| public | story_characters | created_at | timestamp with time zone | NO | timezone('utc'::text, now()) | +| public | story_characters | updated_at | timestamp with time zone | NO | timezone('utc'::text, now()) | +| public | story_settings | id | uuid | NO | uuid_generate_v4() | +| public | story_settings | active | boolean | YES | true | +| public | story_settings | created_at | timestamp with time zone | NO | timezone('utc'::text, now()) | +| public | story_settings | updated_at | timestamp with time zone | NO | timezone('utc'::text, now()) | +| public | teacher_invites | id | uuid | NO | uuid_generate_v4() | +| public | teacher_invites | school_id | uuid | NO | null | +| public | teacher_invites | expires_at | timestamp with time zone | NO | null | +| public | teacher_invites | created_at | timestamp with time zone | NO | timezone('utc'::text, now()) | +| public | phonics_exercises | id | uuid | NO | uuid_generate_v4() | +| public | phonics_exercises | category_id | uuid | YES | null | +| public | phonics_exercises | type_id | uuid | YES | null | +| public | phonics_exercises | difficulty_level | integer | NO | null | +| public | phonics_exercises | estimated_time_seconds | integer | YES | null | +| public | phonics_exercises | points | integer | YES | 10 | +| public | phonics_exercises | is_active | boolean | YES | true | +| public | phonics_exercises | required_score | double precision | YES | 0.7 | +| public | phonics_exercises | created_at | timestamp with time zone | YES | CURRENT_TIMESTAMP | +| public | phonics_exercises | updated_at | timestamp with time zone | YES | CURRENT_TIMESTAMP | +| public | phonics_exercise_types | id | uuid | NO | uuid_generate_v4() | +| public | phonics_exercise_types | created_at | timestamp with time zone | YES | CURRENT_TIMESTAMP | +| public | phonics_words | id | uuid | NO | uuid_generate_v4() | +| public | phonics_words | syllables_count | integer | NO | null | +| public | phonics_words | created_at | timestamp with time zone | YES | CURRENT_TIMESTAMP | +| public | phonics_exercise_words | id | uuid | NO | uuid_generate_v4() | +| public | phonics_exercise_words | exercise_id | uuid | YES | null | +| public | phonics_exercise_words | word_id | uuid | YES | null | +| public | phonics_exercise_words | is_correct_answer | boolean | YES | false | +| public | phonics_exercise_words | order_index | integer | YES | null | +| public | phonics_exercise_words | created_at | timestamp with time zone | YES | CURRENT_TIMESTAMP | +| public | phonics_categories | id | uuid | NO | uuid_generate_v4() | +| public | phonics_categories | level | integer | NO | null | +| public | phonics_categories | order_index | integer | NO | null | +| public | phonics_categories | created_at | timestamp with time zone | YES | CURRENT_TIMESTAMP | +| public | phonics_categories | updated_at | timestamp with time zone | YES | CURRENT_TIMESTAMP | +| public | phonics_exercise_media | id | uuid | NO | uuid_generate_v4() | +| public | phonics_exercise_media | exercise_id | uuid | YES | null | +| public | phonics_exercise_media | media_type_id | uuid | YES | null | +| public | phonics_exercise_media | order_index | integer | YES | null | +| public | phonics_exercise_media | created_at | timestamp with time zone | YES | CURRENT_TIMESTAMP | +| public | media_types | id | uuid | NO | uuid_generate_v4() | +| public | media_types | created_at | timestamp with time zone | YES | CURRENT_TIMESTAMP | +| public | student_phonics_attempts | id | uuid | NO | uuid_generate_v4() | +| public | student_phonics_attempts | student_id | uuid | YES | null | +| public | student_phonics_attempts | exercise_id | uuid | YES | null | +| public | student_phonics_attempts | score | double precision | NO | null | +| public | student_phonics_attempts | time_spent_seconds | integer | YES | null | +| public | student_phonics_attempts | created_at | timestamp with time zone | YES | CURRENT_TIMESTAMP | +| public | student_phonics_attempt_answers | id | uuid | NO | uuid_generate_v4() | +| public | student_phonics_attempt_answers | attempt_id | uuid | YES | null | +| public | student_phonics_attempt_answers | word_id | uuid | YES | null | +| public | student_phonics_attempt_answers | is_correct | boolean | NO | null | +| public | student_phonics_attempt_answers | created_at | timestamp with time zone | YES | CURRENT_TIMESTAMP | +| public | achievement_types | id | uuid | NO | uuid_generate_v4() | +| public | achievement_types | created_at | timestamp with time zone | YES | CURRENT_TIMESTAMP | +| public | student_phonics_progress | id | uuid | NO | uuid_generate_v4() | +| public | student_phonics_progress | student_id | uuid | YES | null | +| public | student_phonics_progress | exercise_id | uuid | YES | null | +| public | student_phonics_progress | attempts | integer | YES | 0 | +| public | student_phonics_progress | best_score | double precision | YES | 0 | +| public | student_phonics_progress | last_score | double precision | YES | 0 | +| public | student_phonics_progress | completed | boolean | YES | false | +| public | student_phonics_progress | completed_at | timestamp with time zone | YES | null | +| public | student_phonics_progress | stars | integer | YES | 0 | +| public | student_phonics_progress | xp_earned | integer | YES | 0 | +| public | student_phonics_progress | created_at | timestamp with time zone | YES | CURRENT_TIMESTAMP | +| public | student_phonics_progress | updated_at | timestamp with time zone | YES | CURRENT_TIMESTAMP | +| public | student_phonics_progress | total_time_spent_seconds | integer | YES | 0 | +| public | student_phonics_progress | correct_answers_count | integer | YES | 0 | | public | student_phonics_progress | total_answers_count | integer | YES | 0 | -| public | students | guardian_name | text | YES | | -| public | story_pages | image_url_medium | text | YES | | -| net | http_request_queue | id | bigint | NO | nextval('net.http_request_queue_id_seq'::regclass) | -| extensions | pg_stat_statements | dbid | oid | YES | | -| auth | users | id | uuid | NO | | -| auth | mfa_challenges | ip_address | inet | NO | | +| public | student_phonics_progress | last_attempt_at | timestamp with time zone | YES | null | +| public | phonics_achievements | id | uuid | NO | uuid_generate_v4() | +| public | phonics_achievements | type_id | uuid | YES | null | +| public | phonics_achievements | points | integer | YES | 0 | +| public | phonics_achievements | required_count | integer | YES | 1 | +| public | phonics_achievements | created_at | timestamp with time zone | YES | CURRENT_TIMESTAMP | +| public | student_phonics_achievements | id | uuid | NO | uuid_generate_v4() | +| public | student_phonics_achievements | student_id | uuid | YES | null | +| public | student_phonics_achievements | achievement_id | uuid | YES | null | +| public | student_phonics_achievements | earned_at | timestamp with time zone | YES | CURRENT_TIMESTAMP | +| public | phonics_word_audio | id | uuid | NO | uuid_generate_v4() | +| public | phonics_word_audio | created_at | timestamp with time zone | YES | timezone('utc'::text, now()) | +| public | languages | id | uuid | NO | uuid_generate_v4() | +| public | languages | created_at | timestamp with time zone | NO | timezone('utc'::text, now()) | +| public | languages | updated_at | timestamp with time zone | NO | timezone('utc'::text, now()) | +| public | story_recordings | id | uuid | NO | uuid_generate_v4() | +| public | story_recordings | story_id | uuid | YES | null | +| public | story_recordings | student_id | uuid | YES | null | +| public | story_recordings | analysis | jsonb | YES | null | +| public | story_recordings | created_at | timestamp with time zone | NO | now() | +| public | story_recordings | processed_at | timestamp with time zone | YES | null | +| public | story_recordings | fluency_score | integer | YES | null | +| public | story_recordings | pronunciation_score | integer | YES | null | +| public | story_recordings | accuracy_score | integer | YES | null | +| public | story_recordings | comprehension_score | integer | YES | null | +| public | story_recordings | words_per_minute | integer | YES | null | +| public | story_recordings | pause_count | integer | YES | null | +| public | story_recordings | error_count | integer | YES | null | +| public | story_recordings | self_corrections | integer | YES | null | +| public | interests | id | uuid | NO | gen_random_uuid() | +| public | interests | student_id | uuid | NO | null | +| public | interests | created_at | timestamp with time zone | NO | timezone('utc'::text, now()) | +| public | interests | updated_at | timestamp with time zone | NO | timezone('utc'::text, now()) | +| public | achievements | id | uuid | NO | uuid_generate_v4() | +| public | student_achievements_old | id | uuid | NO | uuid_generate_v4() | +| public | student_achievements_old | student_id | uuid | YES | null | +| public | student_achievements_old | achievement_id | uuid | YES | null | +| public | student_achievements_old | earned_at | timestamp with time zone | YES | now() | +| public | student_achievements_old | metadata | jsonb | YES | null | +| public | student_achievements | id | uuid | NO | uuid_generate_v4() | +| public | student_achievements | student_id | uuid | YES | null | +| public | student_achievements | achievement_id | uuid | YES | null | +| public | student_achievements | earned_at | timestamp with time zone | YES | now() | +| public | student_achievements | metadata | jsonb | YES | null | +| auth | saml_relay_states | id | uuid | NO | null | +| auth | saml_relay_states | sso_provider_id | uuid | NO | null | +| auth | saml_relay_states | created_at | timestamp with time zone | YES | null | +| auth | saml_relay_states | updated_at | timestamp with time zone | YES | null | +| auth | saml_relay_states | flow_state_id | uuid | YES | null | +| auth | sso_providers | id | uuid | NO | null | +| auth | sso_providers | created_at | timestamp with time zone | YES | null | +| auth | sso_providers | updated_at | timestamp with time zone | YES | null | +| auth | one_time_tokens | id | uuid | NO | null | +| auth | one_time_tokens | user_id | uuid | NO | null | +| auth | one_time_tokens | token_type | USER-DEFINED | NO | null | +| auth | one_time_tokens | created_at | timestamp without time zone | NO | now() | +| auth | one_time_tokens | updated_at | timestamp without time zone | NO | now() | +| auth | mfa_factors | id | uuid | NO | null | +| auth | mfa_factors | user_id | uuid | NO | null | +| auth | mfa_factors | factor_type | USER-DEFINED | NO | null | +| auth | mfa_factors | status | USER-DEFINED | NO | null | +| auth | mfa_factors | created_at | timestamp with time zone | NO | null | +| auth | mfa_factors | updated_at | timestamp with time zone | NO | null | +| auth | mfa_factors | last_challenged_at | timestamp with time zone | YES | null | +| auth | mfa_factors | web_authn_credential | jsonb | YES | null | +| auth | mfa_factors | web_authn_aaguid | uuid | YES | null | +| auth | mfa_challenges | id | uuid | NO | null | +| auth | mfa_challenges | factor_id | uuid | NO | null | +| auth | mfa_challenges | created_at | timestamp with time zone | NO | null | +| auth | mfa_challenges | verified_at | timestamp with time zone | YES | null | +| auth | mfa_challenges | ip_address | inet | NO | null | +| auth | mfa_challenges | web_authn_session_data | jsonb | YES | null | +| auth | audit_log_entries | instance_id | uuid | YES | null | +| auth | audit_log_entries | id | uuid | NO | null | +| auth | audit_log_entries | payload | json | YES | null | +| auth | audit_log_entries | created_at | timestamp with time zone | YES | null | +| auth | sessions | id | uuid | NO | null | +| auth | sessions | user_id | uuid | NO | null | +| auth | sessions | created_at | timestamp with time zone | YES | null | +| auth | sessions | updated_at | timestamp with time zone | YES | null | +| auth | sessions | factor_id | uuid | YES | null | +| auth | sessions | aal | USER-DEFINED | YES | null | +| auth | sessions | not_after | timestamp with time zone | YES | null | +| auth | sessions | refreshed_at | timestamp without time zone | YES | null | +| auth | sessions | ip | inet | YES | null | +| auth | sso_domains | id | uuid | NO | null | +| auth | sso_domains | sso_provider_id | uuid | NO | null | +| auth | sso_domains | created_at | timestamp with time zone | YES | null | +| auth | sso_domains | updated_at | timestamp with time zone | YES | null | +| auth | mfa_amr_claims | session_id | uuid | NO | null | +| auth | mfa_amr_claims | created_at | timestamp with time zone | NO | null | +| auth | mfa_amr_claims | updated_at | timestamp with time zone | NO | null | +| auth | mfa_amr_claims | id | uuid | NO | null | +| auth | saml_providers | id | uuid | NO | null | +| auth | saml_providers | sso_provider_id | uuid | NO | null | +| auth | saml_providers | attribute_mapping | jsonb | YES | null | +| auth | saml_providers | created_at | timestamp with time zone | YES | null | +| auth | saml_providers | updated_at | timestamp with time zone | YES | null | +| auth | flow_state | id | uuid | NO | null | +| auth | flow_state | user_id | uuid | YES | null | +| auth | flow_state | code_challenge_method | USER-DEFINED | NO | null | +| auth | flow_state | created_at | timestamp with time zone | YES | null | +| auth | flow_state | updated_at | timestamp with time zone | YES | null | +| auth | flow_state | auth_code_issued_at | timestamp with time zone | YES | null | +| auth | identities | user_id | uuid | NO | null | +| auth | identities | identity_data | jsonb | NO | null | +| auth | identities | last_sign_in_at | timestamp with time zone | YES | null | +| auth | identities | created_at | timestamp with time zone | YES | null | +| auth | identities | updated_at | timestamp with time zone | YES | null | +| auth | identities | id | uuid | NO | gen_random_uuid() | +| storage | s3_multipart_uploads_parts | id | uuid | NO | gen_random_uuid() | +| storage | s3_multipart_uploads_parts | size | bigint | NO | 0 | +| storage | s3_multipart_uploads_parts | part_number | integer | NO | null | +| storage | s3_multipart_uploads_parts | created_at | timestamp with time zone | NO | now() | +| storage | s3_multipart_uploads | in_progress_size | bigint | NO | 0 | +| storage | s3_multipart_uploads | created_at | timestamp with time zone | NO | now() | +| realtime | schema_migrations | version | bigint | NO | null | +| extensions | pg_stat_statements | plans | bigint | YES | null | +| extensions | pg_stat_statements | total_plan_time | double precision | YES | null | +| extensions | pg_stat_statements | min_plan_time | double precision | YES | null | +| extensions | pg_stat_statements | max_plan_time | double precision | YES | null | +| extensions | pg_stat_statements | mean_plan_time | double precision | YES | null | +| extensions | pg_stat_statements | stddev_plan_time | double precision | YES | null | +| extensions | pg_stat_statements | calls | bigint | YES | null | +| extensions | pg_stat_statements | total_exec_time | double precision | YES | null | +| extensions | pg_stat_statements | min_exec_time | double precision | YES | null | +| extensions | pg_stat_statements | max_exec_time | double precision | YES | null | +| extensions | pg_stat_statements | mean_exec_time | double precision | YES | null | +| extensions | pg_stat_statements | stddev_exec_time | double precision | YES | null | +| extensions | pg_stat_statements | rows | bigint | YES | null | +| extensions | pg_stat_statements | shared_blks_hit | bigint | YES | null | +| extensions | pg_stat_statements | shared_blks_read | bigint | YES | null | +| extensions | pg_stat_statements | shared_blks_dirtied | bigint | YES | null | +| extensions | pg_stat_statements | shared_blks_written | bigint | YES | null | +| extensions | pg_stat_statements | local_blks_hit | bigint | YES | null | +| extensions | pg_stat_statements | local_blks_read | bigint | YES | null | +| extensions | pg_stat_statements | local_blks_dirtied | bigint | YES | null | +| extensions | pg_stat_statements | local_blks_written | bigint | YES | null | +| extensions | pg_stat_statements | temp_blks_read | bigint | YES | null | +| extensions | pg_stat_statements | temp_blks_written | bigint | YES | null | +| extensions | pg_stat_statements | blk_read_time | double precision | YES | null | +| extensions | pg_stat_statements | blk_write_time | double precision | YES | null | +| extensions | pg_stat_statements | temp_blk_read_time | double precision | YES | null | +| extensions | pg_stat_statements | temp_blk_write_time | double precision | YES | null | +| extensions | pg_stat_statements | wal_records | bigint | YES | null | +| extensions | pg_stat_statements | wal_fpi | bigint | YES | null | +| extensions | pg_stat_statements | wal_bytes | numeric | YES | null | +| extensions | pg_stat_statements | jit_functions | bigint | YES | null | +| extensions | pg_stat_statements | jit_generation_time | double precision | YES | null | +| extensions | pg_stat_statements | jit_inlining_count | bigint | YES | null | +| extensions | pg_stat_statements | jit_inlining_time | double precision | YES | null | +| extensions | pg_stat_statements | jit_optimization_count | bigint | YES | null | +| extensions | pg_stat_statements | jit_optimization_time | double precision | YES | null | +| extensions | pg_stat_statements | jit_emission_count | bigint | YES | null | +| extensions | pg_stat_statements | jit_emission_time | double precision | YES | null | +| public | story_details | id | uuid | YES | null | +| public | story_details | student_id | uuid | YES | null | +| public | story_details | content | jsonb | YES | null | +| public | story_details | created_at | timestamp with time zone | YES | null | +| public | story_details | updated_at | timestamp with time zone | YES | null | +| public | story_details | theme_id | uuid | YES | null | +| public | story_details | subject_id | uuid | YES | null | +| public | story_details | character_id | uuid | YES | null | +| public | story_details | setting_id | uuid | YES | null | +| public | story_exercise_words | id | uuid | NO | uuid_generate_v4() | +| public | story_exercise_words | story_id | uuid | YES | null | +| public | story_exercise_words | created_at | timestamp with time zone | YES | now() | +| realtime | subscription | id | bigint | NO | null | +| realtime | subscription | subscription_id | uuid | NO | null | +| realtime | subscription | entity | regclass | NO | null | +| realtime | subscription | filters | ARRAY | NO | '{}'::realtime.user_defined_filter[] | +| realtime | subscription | claims | jsonb | NO | null | +| realtime | subscription | claims_role | regrole | NO | null | +| realtime | subscription | created_at | timestamp without time zone | NO | timezone('utc'::text, now()) | +| auth | instances | id | uuid | NO | null | +| auth | instances | uuid | uuid | YES | null | +| auth | instances | created_at | timestamp with time zone | YES | null | +| auth | instances | updated_at | timestamp with time zone | YES | null | +| auth | users | instance_id | uuid | YES | null | +| auth | users | id | uuid | NO | null | +| auth | users | email_confirmed_at | timestamp with time zone | YES | null | +| auth | users | invited_at | timestamp with time zone | YES | null | +| auth | users | confirmation_sent_at | timestamp with time zone | YES | null | +| auth | users | recovery_sent_at | timestamp with time zone | YES | null | +| auth | users | email_change_sent_at | timestamp with time zone | YES | null | +| auth | users | last_sign_in_at | timestamp with time zone | YES | null | +| auth | users | raw_app_meta_data | jsonb | YES | null | +| auth | users | raw_user_meta_data | jsonb | YES | null | +| auth | users | is_super_admin | boolean | YES | null | +| auth | users | created_at | timestamp with time zone | YES | null | +| auth | users | updated_at | timestamp with time zone | YES | null | +| auth | users | phone_confirmed_at | timestamp with time zone | YES | null | +| auth | users | phone_change_sent_at | timestamp with time zone | YES | null | +| auth | users | confirmed_at | timestamp with time zone | YES | null | +| auth | users | email_change_confirm_status | smallint | YES | 0 | +| auth | users | banned_until | timestamp with time zone | YES | null | +| auth | users | reauthentication_sent_at | timestamp with time zone | YES | null | +| auth | users | is_sso_user | boolean | NO | false | +| auth | users | deleted_at | timestamp with time zone | YES | null | +| auth | users | is_anonymous | boolean | NO | false | +| auth | refresh_tokens | instance_id | uuid | YES | null | +| auth | refresh_tokens | id | bigint | NO | nextval('auth.refresh_tokens_id_seq'::regclass) | +| auth | refresh_tokens | revoked | boolean | YES | null | +| auth | refresh_tokens | created_at | timestamp with time zone | YES | null | +| auth | refresh_tokens | updated_at | timestamp with time zone | YES | null | +| auth | refresh_tokens | session_id | uuid | YES | null | +| storage | buckets | owner | uuid | YES | null | +| storage | buckets | created_at | timestamp with time zone | YES | now() | +| storage | buckets | updated_at | timestamp with time zone | YES | now() | +| storage | buckets | public | boolean | YES | false | | storage | buckets | avif_autodetection | boolean | YES | false | -| public | classes | year | integer | NO | | \ No newline at end of file +| storage | buckets | file_size_limit | bigint | YES | null | +| storage | objects | id | uuid | NO | gen_random_uuid() | +| storage | objects | owner | uuid | YES | null | +| storage | objects | created_at | timestamp with time zone | YES | now() | +| storage | objects | updated_at | timestamp with time zone | YES | now() | +| storage | objects | last_accessed_at | timestamp with time zone | YES | now() | +| storage | objects | metadata | jsonb | YES | null | +| storage | objects | user_metadata | jsonb | YES | null | +| storage | migrations | id | integer | NO | null | +| storage | migrations | executed_at | timestamp without time zone | YES | CURRENT_TIMESTAMP | +| pgsodium | mask_columns | attrelid | oid | YES | null | +| pgsodium | valid_key | id | uuid | YES | null | +| pgsodium | valid_key | status | USER-DEFINED | YES | null | +| pgsodium | valid_key | key_type | USER-DEFINED | YES | null | +| pgsodium | valid_key | key_id | bigint | YES | null | +| pgsodium | valid_key | key_context | bytea | YES | null | +| pgsodium | valid_key | created | timestamp with time zone | YES | null | +| pgsodium | valid_key | expires | timestamp with time zone | YES | null | +| pgsodium | decrypted_key | id | uuid | YES | null | +| pgsodium | decrypted_key | status | USER-DEFINED | YES | null | +| pgsodium | decrypted_key | created | timestamp with time zone | YES | null | +| pgsodium | decrypted_key | expires | timestamp with time zone | YES | null | +| pgsodium | decrypted_key | key_type | USER-DEFINED | YES | null | +| pgsodium | decrypted_key | key_id | bigint | YES | null | +| pgsodium | decrypted_key | key_context | bytea | YES | null | +| pgsodium | decrypted_key | raw_key | bytea | YES | null | +| pgsodium | decrypted_key | decrypted_raw_key | bytea | YES | null | +| pgsodium | decrypted_key | raw_key_nonce | bytea | YES | null | +| pgsodium | decrypted_key | parent_key | uuid | YES | null | +| pgsodium | key | id | uuid | NO | gen_random_uuid() | +| pgsodium | key | status | USER-DEFINED | YES | 'valid'::pgsodium.key_status | +| pgsodium | key | created | timestamp with time zone | NO | CURRENT_TIMESTAMP | +| pgsodium | key | expires | timestamp with time zone | YES | null | +| pgsodium | key | key_type | USER-DEFINED | YES | null | +| pgsodium | key | key_id | bigint | YES | nextval('pgsodium.key_key_id_seq'::regclass) | +| pgsodium | key | key_context | bytea | YES | '\x7067736f6469756d'::bytea | +| pgsodium | key | raw_key | bytea | YES | null | +| pgsodium | key | raw_key_nonce | bytea | YES | null | +| pgsodium | key | parent_key | uuid | YES | null | +| pgsodium | masking_rule | attrelid | oid | YES | null | +| pgsodium | masking_rule | attnum | integer | YES | null | +| pgsodium | masking_rule | relnamespace | regnamespace | YES | null | +| pgsodium | masking_rule | priority | integer | YES | null | +| pgsodium | masking_rule | security_invoker | boolean | YES | null | +| vault | secrets | id | uuid | NO | gen_random_uuid() | +| vault | secrets | key_id | uuid | YES | (pgsodium.create_key()).id | +| vault | secrets | nonce | bytea | YES | pgsodium.crypto_aead_det_noncegen() | +| vault | secrets | created_at | timestamp with time zone | NO | CURRENT_TIMESTAMP | +| vault | secrets | updated_at | timestamp with time zone | NO | CURRENT_TIMESTAMP | +| vault | decrypted_secrets | id | uuid | YES | null | +| vault | decrypted_secrets | key_id | uuid | YES | null | +| vault | decrypted_secrets | nonce | bytea | YES | null | +| vault | decrypted_secrets | created_at | timestamp with time zone | YES | null | +| vault | decrypted_secrets | updated_at | timestamp with time zone | YES | null | +| realtime | messages | payload | jsonb | YES | null | +| realtime | messages | private | boolean | YES | false | +| realtime | messages | updated_at | timestamp without time zone | NO | now() | +| realtime | messages | inserted_at | timestamp without time zone | NO | now() | +| realtime | messages | id | uuid | NO | gen_random_uuid() | +| public | story_generations | id | uuid | NO | uuid_generate_v4() | +| public | story_generations | story_id | uuid | YES | null | +| public | story_generations | created_at | timestamp with time zone | NO | timezone('utc'::text, now()) | +| public | story_generations | language_type | USER-DEFINED | NO | 'pt-BR'::language_enum | +| net | http_request_queue | id | bigint | NO | nextval('net.http_request_queue_id_seq'::regclass) | +| net | http_request_queue | headers | jsonb | NO | null | +| net | http_request_queue | body | bytea | YES | null | +| net | http_request_queue | timeout_milliseconds | integer | NO | null | +| net | _http_response | id | bigint | YES | null | +| net | _http_response | status_code | integer | YES | null | +| net | _http_response | headers | jsonb | YES | null | +| net | _http_response | timed_out | boolean | YES | null | +| net | _http_response | created | timestamp with time zone | NO | now() | +| public | story_pages | id | uuid | NO | uuid_generate_v4() | +| public | story_pages | story_id | uuid | YES | null | +| public | story_pages | page_number | integer | NO | null | +| public | story_pages | created_at | timestamp with time zone | NO | timezone('utc'::text, now()) | +| public | schools | id | uuid | NO | uuid_generate_v4() | +| public | schools | created_at | timestamp with time zone | NO | timezone('utc'::text, now()) | +| public | schools | updated_at | timestamp with time zone | NO | timezone('utc'::text, now()) | +| public | teachers | id | uuid | NO | uuid_generate_v4() | +| public | teachers | school_id | uuid | NO | null | +| public | teachers | created_at | timestamp with time zone | NO | timezone('utc'::text, now()) | +| public | teachers | updated_at | timestamp with time zone | NO | timezone('utc'::text, now()) | +| public | teachers | class_ids | ARRAY | YES | null | +| public | classes | id | uuid | NO | uuid_generate_v4() | +| public | classes | school_id | uuid | NO | null | +| public | classes | year | integer | NO | null | +| public | classes | created_at | timestamp with time zone | NO | timezone('utc'::text, now()) | +| public | classes | updated_at | timestamp with time zone | NO | timezone('utc'::text, now()) | +| public | classes | teacher_id | uuid | YES | null | +| public | teacher_classes | id | uuid | NO | uuid_generate_v4() | +| storage | s3_multipart_uploads_parts | owner_id | text | YES | null | +| auth | mfa_amr_claims | authentication_method | text | NO | null | +| auth | identities | provider | text | NO | null | +| storage | s3_multipart_uploads_parts | version | text | NO | null | +| realtime | messages | topic | text | NO | null | +| realtime | messages | extension | text | NO | null | +| public | teacher_invites | email | text | NO | null | +| realtime | messages | event | text | YES | null | +| public | teacher_invites | name | text | NO | null | +| public | teacher_invites | subject | text | YES | null | +| public | teacher_invites | message | text | YES | null | +| public | teacher_invites | status | text | YES | 'pending'::text | +| public | teacher_invites | token | text | NO | null | +| storage | s3_multipart_uploads | version | text | NO | null | +| public | story_generations | original_prompt | text | NO | null | +| public | story_generations | ai_response | text | NO | null | +| public | story_generations | model_used | text | NO | null | +| auth | saml_providers | entity_id | text | NO | null | +| auth | mfa_challenges | otp_code | text | YES | null | +| auth | saml_providers | metadata_xml | text | NO | null | +| net | http_request_queue | method | text | NO | null | +| net | http_request_queue | url | text | NO | null | +| auth | saml_providers | metadata_url | text | YES | null | +| public | phonics_exercises | title | character varying | NO | null | +| public | phonics_exercises | description | text | YES | null | +| public | phonics_achievements | name | character varying | NO | null | +| public | phonics_achievements | description | text | YES | null | +| net | _http_response | content_type | text | YES | null | +| public | phonics_exercises | instructions | text | NO | null | +| net | _http_response | content | text | YES | null | +| storage | s3_multipart_uploads | id | text | NO | null | +| net | _http_response | error_msg | text | YES | null | +| public | phonics_achievements | icon_url | text | YES | null | +| auth | identities | email | text | YES | null | +| storage | s3_multipart_uploads | owner_id | text | YES | null | +| auth | saml_relay_states | request_id | text | NO | null | +| public | story_pages | text | text | NO | null | +| public | story_pages | image_url | text | NO | null | +| auth | saml_relay_states | for_email | text | YES | null | +| public | story_pages | image_path | text | YES | null | +| public | story_pages | image_url_thumb | text | YES | null | +| public | story_details | title | text | YES | null | +| public | story_pages | image_url_medium | text | YES | null | +| public | story_details | status | text | YES | null | +| public | story_pages | image_url_large | text | YES | null | +| public | story_pages | image_path_thumb | text | YES | null | +| public | story_pages | image_path_medium | text | YES | null | +| public | story_pages | image_path_large | text | YES | null | +| public | story_pages | text_syllables | text | YES | null | +| public | phonics_exercise_types | name | character varying | NO | null | +| public | story_details | context | text | YES | null | +| public | story_details | theme_title | text | YES | null | +| public | story_details | theme_icon | text | YES | null | +| public | story_details | subject_title | text | YES | null | +| public | story_details | subject_icon | text | YES | null | +| public | story_details | character_title | text | YES | null | +| public | story_details | character_icon | text | YES | null | +| public | story_details | setting_title | text | YES | null | +| public | story_details | setting_icon | text | YES | null | +| public | schools | name | text | NO | null | +| public | schools | address | text | YES | null | +| public | story_exercise_words | word | text | NO | null | +| public | story_exercise_words | exercise_type | text | NO | null | +| public | story_exercise_words | phonemes | ARRAY | YES | null | +| public | story_exercise_words | syllable_pattern | text | YES | null | +| public | schools | phone | text | YES | null | +| public | schools | email | text | YES | null | +| public | phonics_exercise_types | description | text | YES | null | +| auth | saml_relay_states | redirect_to | text | YES | null | +| public | schools | director_name | text | NO | 'Não informado'::text | +| auth | audit_log_entries | ip_address | character varying | NO | ''::character varying | +| public | phonics_words | word | character varying | NO | null | +| public | teachers | name | text | NO | null | +| auth | schema_migrations | version | character varying | NO | null | +| public | teachers | email | text | NO | null | +| public | teachers | phone | text | YES | null | +| auth | instances | raw_base_config | text | YES | null | +| public | teachers | subject | text | YES | null | +| public | phonics_words | phonetic_transcription | character varying | YES | null | +| auth | saml_providers | name_id_format | text | YES | null | +| public | teachers | status | text | YES | 'pending'::text | +| auth | users | aud | character varying | YES | null | +| auth | users | role | character varying | YES | null | +| auth | users | email | character varying | YES | null | +| auth | users | encrypted_password | character varying | YES | null | +| public | phonics_word_audio | word | text | NO | null | +| public | phonics_word_audio | audio_url | text | NO | null | +| auth | users | confirmation_token | character varying | YES | null | +| public | phonics_word_audio | audio_path | text | NO | null | +| auth | users | recovery_token | character varying | YES | null | +| public | classes | name | text | NO | null | +| auth | users | email_change_token_new | character varying | YES | null | +| auth | users | email_change | character varying | YES | null | +| public | classes | grade | text | NO | null | +| storage | s3_multipart_uploads | upload_signature | text | NO | null | +| public | classes | period | text | YES | null | +| storage | s3_multipart_uploads_parts | upload_id | text | NO | null | +| public | languages | name | character varying | NO | null | +| public | languages | code | character varying | NO | null | +| public | languages | instructions | text | YES | null | +| auth | users | phone | text | YES | NULL::character varying | +| public | phonics_categories | name | character varying | NO | null | +| auth | users | phone_change | text | YES | ''::character varying | +| auth | users | phone_change_token | character varying | YES | ''::character varying | +| public | phonics_categories | description | text | YES | null | +| public | languages | flag_icon | character varying | YES | null | +| auth | users | email_change_token_current | character varying | YES | ''::character varying | +| auth | sso_providers | resource_id | text | YES | null | +| auth | flow_state | auth_code | text | NO | null | +| auth | users | reauthentication_token | character varying | YES | ''::character varying | +| public | students | name | text | NO | null | +| public | students | email | text | NO | null | +| storage | s3_multipart_uploads | bucket_id | text | NO | null | +| public | students | guardian_name | text | YES | null | +| public | students | guardian_phone | text | YES | null | +| public | students | guardian_email | text | YES | null | +| auth | refresh_tokens | token | character varying | YES | null | +| auth | refresh_tokens | user_id | character varying | YES | null | +| auth | flow_state | code_challenge | text | NO | null | +| auth | flow_state | provider_type | text | NO | null | +| public | students | status | text | NO | 'active'::text | +| auth | refresh_tokens | parent | character varying | YES | null | +| public | story_recordings | audio_url | text | YES | null | +| supabase_migrations | seed_files | path | text | NO | null | +| supabase_migrations | seed_files | hash | text | NO | null | +| supabase_migrations | schema_migrations | version | text | NO | null | +| supabase_migrations | schema_migrations | statements | ARRAY | YES | null | +| supabase_migrations | schema_migrations | name | text | YES | null | +| storage | buckets | id | text | NO | null | +| storage | buckets | name | text | NO | null | +| public | students | avatar_url | text | YES | null | +| public | students | nickname | character varying | YES | null | +| public | phonics_exercise_media | url | text | NO | null | +| public | phonics_exercise_media | alt_text | text | YES | null | +| public | students | preferred_themes | ARRAY | YES | null | +| public | story_recordings | status | text | NO | 'pending_analysis'::text | +| storage | buckets | allowed_mime_types | ARRAY | YES | null | +| storage | buckets | owner_id | text | YES | null | +| auth | flow_state | provider_access_token | text | YES | null | +| storage | objects | bucket_id | text | YES | null | +| storage | objects | name | text | YES | null | +| auth | one_time_tokens | token_hash | text | NO | null | +| public | media_types | name | character varying | NO | null | +| public | media_types | description | text | YES | null | +| public | story_recordings | transcription | text | YES | null | +| auth | one_time_tokens | relates_to | text | NO | null | +| storage | objects | path_tokens | ARRAY | YES | null | +| storage | objects | version | text | YES | null | +| storage | objects | owner_id | text | YES | null | +| public | story_recordings | error_message | text | YES | null | +| auth | sessions | user_agent | text | YES | null | +| storage | migrations | name | character varying | NO | null | +| storage | migrations | hash | character varying | NO | null | +| public | stories | title | text | NO | null | +| pgsodium | masking_rule | format_type | text | YES | null | +| auth | identities | provider_id | text | NO | null | +| storage | s3_multipart_uploads_parts | etag | text | NO | null | +| public | achievements | name | text | YES | null | +| vault | secrets | name | text | YES | null | +| vault | secrets | description | text | NO | ''::text | +| vault | secrets | secret | text | NO | null | +| public | story_settings | slug | text | NO | null | +| public | story_settings | title | text | NO | null | +| public | story_settings | description | text | NO | null | +| public | story_settings | icon | text | NO | null | +| public | achievements | description | text | YES | null | +| vault | decrypted_secrets | name | text | YES | null | +| vault | decrypted_secrets | description | text | YES | null | +| vault | decrypted_secrets | secret | text | YES | null | +| extensions | pg_stat_statements | query | text | YES | null | +| auth | flow_state | provider_refresh_token | text | YES | null | +| pgsodium | mask_columns | format_type | text | YES | null | +| public | stories | status | text | YES | 'draft'::text | +| pgsodium | valid_key | name | text | YES | null | +| auth | sessions | tag | text | YES | null | +| auth | mfa_factors | friendly_name | text | YES | null | +| storage | s3_multipart_uploads_parts | bucket_id | text | NO | null | +| auth | sso_domains | domain | text | NO | null | +| auth | flow_state | authentication_method | text | NO | null | +| pgsodium | valid_key | associated_data | text | YES | null | +| public | stories | context | text | YES | null | +| public | student_phonics_attempt_answers | answer_text | text | YES | null | +| public | story_recordings | strengths | ARRAY | YES | null | +| public | story_themes | slug | text | NO | null | +| public | story_themes | title | text | NO | null | +| public | story_themes | description | text | NO | null | +| public | story_themes | icon | text | NO | null | +| pgsodium | decrypted_key | name | text | YES | null | +| pgsodium | decrypted_key | associated_data | text | YES | null | +| public | story_recordings | improvements | ARRAY | YES | null | +| public | achievement_types | name | character varying | NO | null | +| public | achievement_types | description | text | YES | null | +| public | story_recordings | suggestions | text | YES | null | +| pgsodium | decrypted_key | comment | text | YES | null | +| public | story_subjects | slug | text | NO | null | +| public | story_subjects | title | text | NO | null | +| public | story_subjects | description | text | NO | null | +| public | story_subjects | icon | text | NO | null | +| auth | mfa_factors | secret | text | YES | null | +| public | interests | category | text | NO | null | +| pgsodium | key | name | text | YES | null | +| pgsodium | key | associated_data | text | YES | 'associated'::text | +| public | interests | item | text | NO | null | +| public | story_characters | slug | text | NO | null | +| public | story_characters | title | text | NO | null | +| pgsodium | key | comment | text | YES | null | +| pgsodium | key | user_data | text | YES | null | +| public | story_characters | description | text | NO | null | +| public | story_characters | icon | text | NO | null | +| auth | mfa_factors | phone | text | YES | null | +| pgsodium | mask_columns | attname | name | YES | null | +| pgsodium | masking_rule | nonce_column | text | YES | null | +| pgsodium | mask_columns | key_id | text | YES | null | +| pgsodium | mask_columns | key_id_column | text | YES | null | +| pgsodium | mask_columns | associated_columns | text | YES | null | +| pgsodium | mask_columns | nonce_column | text | YES | null | +| pgsodium | masking_rule | view_name | text | YES | null | +| pgsodium | masking_rule | relname | name | YES | null | +| pgsodium | masking_rule | attname | name | YES | null | +| vault | decrypted_secrets | decrypted_secret | text | YES | null | +| storage | s3_multipart_uploads | key | text | NO | null | +| pgsodium | masking_rule | col_description | text | YES | null | +| pgsodium | masking_rule | key_id_column | text | YES | null | +| pgsodium | masking_rule | key_id | text | YES | null | +| storage | s3_multipart_uploads_parts | key | text | NO | null | +| pgsodium | masking_rule | associated_columns | text | YES | null | \ No newline at end of file diff --git a/supabase/contexts/policies.md b/supabase/contexts/policies.md index 4a7661d..bd0a459 100644 --- a/supabase/contexts/policies.md +++ b/supabase/contexts/policies.md @@ -1,29 +1,29 @@ | policy_id | schema_name | table_name | policy_name | command | policy_using | policy_check | | --------- | ----------- | ---------------------- | ------------------------------------------------------------- | ------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | -| 29823 | auth | users | Validate user metadata | * | (((raw_user_meta_data ->> 'role'::text))::user_role IS NOT NULL) | | -| 29615 | public | classes | Schools can create classes | a | | (school_id = auth.uid()) | +| 29823 | auth | users | Validate user metadata | * | (((raw_user_meta_data ->> 'role'::text))::user_role IS NOT NULL) | null | +| 29615 | public | classes | Schools can create classes | a | null | (school_id = auth.uid()) | | 29616 | public | classes | Schools can update their classes | w | (school_id = auth.uid()) | (school_id = auth.uid()) | -| 29614 | public | classes | Schools can view their classes | r | (school_id = auth.uid()) | | -| 29301 | public | classes | Turmas visíveis para usuários autenticados | r | true | | -| 65878 | public | interests | Students can delete their own interests | d | (auth.uid() = student_id) | | -| 65876 | public | interests | Students can insert their own interests | a | | (auth.uid() = student_id) | +| 29614 | public | classes | Schools can view their classes | r | (school_id = auth.uid()) | null | +| 29301 | public | classes | Turmas visíveis para usuários autenticados | r | true | null | +| 65878 | public | interests | Students can delete their own interests | d | (auth.uid() = student_id) | null | +| 65876 | public | interests | Students can insert their own interests | a | null | (auth.uid() = student_id) | | 65877 | public | interests | Students can update their own interests | w | (auth.uid() = student_id) | (auth.uid() = student_id) | -| 65875 | public | interests | Students can view their own interests | r | (auth.uid() = student_id) | | +| 65875 | public | interests | Students can view their own interests | r | (auth.uid() = student_id) | null | | 104599 | public | languages | Allow insert/update for admins only | * | ((auth.jwt() ->> 'role'::text) = 'admin'::text) | ((auth.jwt() ->> 'role'::text) = 'admin'::text) | -| 104598 | public | languages | Allow read access for all authenticated users | r | true | | -| 79931 | public | phonics_categories | Permitir leitura de categorias fonéticas para usuários autent | r | true | | -| 79932 | public | phonics_exercise_types | Permitir leitura de tipos de exercícios fonéticos para usuár | r | true | | -| 79934 | public | phonics_exercise_words | Permitir leitura de relações exercício-palavra para usuário | r | true | | -| 79930 | public | phonics_exercises | Permitir leitura de exercícios fonéticos para usuários auten | r | true | | -| 79933 | public | phonics_words | Permitir leitura de palavras fonéticas para usuários autentic | r | true | | -| 29440 | public | schools | Enable insert for registration | a | | true | -| 29299 | public | schools | Escolas visíveis para usuários autenticados | r | true | | +| 104598 | public | languages | Allow read access for all authenticated users | r | true | null | +| 79931 | public | phonics_categories | Permitir leitura de categorias fonéticas para usuários autent | r | true | null | +| 79932 | public | phonics_exercise_types | Permitir leitura de tipos de exercícios fonéticos para usuár | r | true | null | +| 79934 | public | phonics_exercise_words | Permitir leitura de relações exercício-palavra para usuário | r | true | null | +| 79930 | public | phonics_exercises | Permitir leitura de exercícios fonéticos para usuários auten | r | true | null | +| 79933 | public | phonics_words | Permitir leitura de palavras fonéticas para usuários autentic | r | true | null | +| 29440 | public | schools | Enable insert for registration | a | null | true | +| 29299 | public | schools | Escolas visíveis para usuários autenticados | r | true | null | | 29442 | public | schools | Schools can update own data | w | (auth.uid() = id) | (auth.uid() = id) | -| 29441 | public | schools | Schools can view own data | r | (auth.uid() = id) | | +| 29441 | public | schools | Schools can view own data | r | (auth.uid() = id) | null | | 29347 | public | stories | Alunos podem atualizar suas próprias histórias | w | (student_id IN ( SELECT students.id FROM students - WHERE (students.email = auth.email()))) | | -| 29346 | public | stories | Alunos podem criar suas próprias histórias | a | | (student_id IN ( SELECT students.id + WHERE (students.email = auth.email()))) | null | +| 29346 | public | stories | Alunos podem criar suas próprias histórias | a | null | (student_id IN ( SELECT students.id FROM students WHERE (students.email = auth.email()))) | | 36241 | public | stories | Estudantes podem ver suas próprias histórias | r | ((auth.uid() = student_id) AND (EXISTS ( SELECT 1 @@ -34,60 +34,60 @@ FROM story_characters WHERE ((story_characters.id = stories.character_id) AND (story_characters.active = true)))) AND (EXISTS ( SELECT 1 FROM story_settings - WHERE ((story_settings.id = stories.setting_id) AND (story_settings.active = true))))) | | -| 29345 | public | stories | Histórias visíveis para usuários autenticados | r | true | | -| 53384 | public | stories | Permitir deleção pelo dono | d | (auth.uid() = student_id) | | -| 34952 | public | story_characters | Permitir leitura pública dos personagens | r | (active = true) | | -| 53955 | public | story_exercise_words | Apenas sistema pode inserir | a | | (auth.role() = 'service_role'::text) | -| 53954 | public | story_exercise_words | Leitura pública das palavras | r | true | | -| 37664 | public | story_generations | Apenas service_role pode inserir metadados | a | | true | -| 37663 | public | story_generations | Metadados são visíveis para todos | r | true | | -| 37662 | public | story_pages | Apenas service_role pode inserir páginas | a | | true | -| 37661 | public | story_pages | Páginas são visíveis para todos | r | true | | + WHERE ((story_settings.id = stories.setting_id) AND (story_settings.active = true))))) | null | +| 29345 | public | stories | Histórias visíveis para usuários autenticados | r | true | null | +| 53384 | public | stories | Permitir deleção pelo dono | d | (auth.uid() = student_id) | null | +| 34952 | public | story_characters | Permitir leitura pública dos personagens | r | (active = true) | null | +| 53955 | public | story_exercise_words | Apenas sistema pode inserir | a | null | (auth.role() = 'service_role'::text) | +| 53954 | public | story_exercise_words | Leitura pública das palavras | r | true | null | +| 37664 | public | story_generations | Apenas service_role pode inserir metadados | a | null | true | +| 37663 | public | story_generations | Metadados são visíveis para todos | r | true | null | +| 37662 | public | story_pages | Apenas service_role pode inserir páginas | a | null | true | +| 37661 | public | story_pages | Páginas são visíveis para todos | r | true | null | | 31560 | public | story_recordings | Escolas podem ver todas as gravações | r | (EXISTS ( SELECT 1 FROM students s - WHERE ((s.id = story_recordings.student_id) AND (s.school_id = auth.uid())))) | | -| 30092 | public | story_recordings | Estudantes podem gravar áudios | a | | (auth.uid() = student_id) | -| 31511 | public | story_recordings | Estudantes podem ver suas próprias gravações | r | (auth.uid() = student_id) | | + WHERE ((s.id = story_recordings.student_id) AND (s.school_id = auth.uid())))) | null | +| 30092 | public | story_recordings | Estudantes podem gravar áudios | a | null | (auth.uid() = student_id) | +| 31511 | public | story_recordings | Estudantes podem ver suas próprias gravações | r | (auth.uid() = student_id) | null | | 31558 | public | story_recordings | Professores podem ver gravações de seus alunos | r | (EXISTS ( SELECT 1 FROM (classes c JOIN students s ON ((s.class_id = c.id))) - WHERE ((s.id = story_recordings.student_id) AND (c.teacher_id = auth.uid())))) | | -| 29748 | public | story_recordings | Students can insert their own recordings | a | | (auth.uid() = student_id) | -| 29749 | public | story_recordings | Students can view their own recordings | r | (auth.uid() = student_id) | | -| 34953 | public | story_settings | Permitir leitura pública dos cenários | r | (active = true) | | -| 34951 | public | story_subjects | Permitir leitura pública das disciplinas | r | (active = true) | | -| 34950 | public | story_themes | Permitir leitura pública das categorias | r | (active = true) | | -| 29302 | public | students | Alunos visíveis para usuários autenticados | r | true | | -| 29638 | public | students | Escolas podem inserir seus próprios alunos | a | | (auth.uid() IN ( SELECT schools.id + WHERE ((s.id = story_recordings.student_id) AND (c.teacher_id = auth.uid())))) | null | +| 29748 | public | story_recordings | Students can insert their own recordings | a | null | (auth.uid() = student_id) | +| 29749 | public | story_recordings | Students can view their own recordings | r | (auth.uid() = student_id) | null | +| 34953 | public | story_settings | Permitir leitura pública dos cenários | r | (active = true) | null | +| 34951 | public | story_subjects | Permitir leitura pública das disciplinas | r | (active = true) | null | +| 34950 | public | story_themes | Permitir leitura pública das categorias | r | (active = true) | null | +| 29302 | public | students | Alunos visíveis para usuários autenticados | r | true | null | +| 29638 | public | students | Escolas podem inserir seus próprios alunos | a | null | (auth.uid() IN ( SELECT schools.id FROM schools WHERE (schools.id = students.school_id))) | | 29639 | public | students | Escolas podem ver seus próprios alunos | r | (auth.uid() IN ( SELECT schools.id FROM schools - WHERE (schools.id = students.school_id))) | | -| 29584 | public | students | Schools can view their students | r | (school_id = auth.uid()) | | -| 29511 | public | teacher_invites | Schools can invite teachers | a | | (school_id IN ( SELECT schools.id + WHERE (schools.id = students.school_id))) | null | +| 29584 | public | students | Schools can view their students | r | (school_id = auth.uid()) | null | +| 29511 | public | teacher_invites | Schools can invite teachers | a | null | (school_id IN ( SELECT schools.id FROM schools WHERE (schools.id = auth.uid()))) | -| 29300 | public | teachers | Professores visíveis para usuários autenticados | r | true | | +| 29300 | public | teachers | Professores visíveis para usuários autenticados | r | true | null | | 29510 | public | teachers | Schools can view their teachers | r | (school_id IN ( SELECT schools.id FROM schools - WHERE (schools.id = auth.uid()))) | | -| 29509 | public | teachers | Teachers can view own data | r | (auth.uid() = id) | | -| 29717 | storage | objects | Anyone can read recordings | r | (bucket_id = 'recordings'::text) | | -| 30136 | storage | objects | Estudantes podem fazer upload de áudios | a | | ((bucket_id = 'recordings'::text) AND ((auth.uid())::text = (storage.foldername(name))[1])) | -| 75352 | storage | objects | Imagens são publicamente acessíveis | r | (bucket_id = 'story-images'::text) | | -| 43940 | storage | objects | Permitir acesso da Edge Function | r | ((bucket_id = 'recordings'::text) AND ((auth.jwt() ->> 'role'::text) = 'service_role'::text)) | | -| 52098 | storage | objects | Permitir acesso público para leitura | r | (bucket_id = 'recordings'::text) | | -| 37570 | storage | objects | Permitir acesso público para leitura de imagens de histórias | r | (bucket_id = 'story-images'::text) | | -| 37573 | storage | objects | Permitir delete pela edge function | d | (bucket_id = 'story-images'::text) | | + WHERE (schools.id = auth.uid()))) | null | +| 29509 | public | teachers | Teachers can view own data | r | (auth.uid() = id) | null | +| 29717 | storage | objects | Anyone can read recordings | r | (bucket_id = 'recordings'::text) | null | +| 30136 | storage | objects | Estudantes podem fazer upload de áudios | a | null | ((bucket_id = 'recordings'::text) AND ((auth.uid())::text = (storage.foldername(name))[1])) | +| 75352 | storage | objects | Imagens são publicamente acessíveis | r | (bucket_id = 'story-images'::text) | null | +| 43940 | storage | objects | Permitir acesso da Edge Function | r | ((bucket_id = 'recordings'::text) AND ((auth.jwt() ->> 'role'::text) = 'service_role'::text)) | null | +| 52098 | storage | objects | Permitir acesso público para leitura | r | (bucket_id = 'recordings'::text) | null | +| 37570 | storage | objects | Permitir acesso público para leitura de imagens de histórias | r | (bucket_id = 'story-images'::text) | null | +| 37573 | storage | objects | Permitir delete pela edge function | d | (bucket_id = 'story-images'::text) | null | | 53468 | storage | objects | Permitir deleção de imagens pelo dono da história | d | ((bucket_id = 'story-images'::text) AND (EXISTS ( SELECT 1 FROM stories s - WHERE ((s.id = ((storage.foldername(objects.name))[1])::uuid) AND (s.student_id = auth.uid()))))) | | -| 53426 | storage | objects | Permitir deleção pelo dono do arquivo | d | ((bucket_id = 'recordings'::text) AND ((storage.foldername(name))[1] = (auth.uid())::text)) | | -| 52099 | storage | objects | Permitir download público | r | (bucket_id = 'recordings'::text) | | -| 37572 | storage | objects | Permitir update pela edge function | w | (bucket_id = 'story-images'::text) | | -| 43939 | storage | objects | Permitir upload de áudios autenticado | a | | ((bucket_id = 'recordings'::text) AND (auth.role() = 'authenticated'::text)) | -| 37571 | storage | objects | Permitir upload pela edge function | a | | (bucket_id = 'story-images'::text) | -| 29716 | storage | objects | Students can upload their recordings | a | | ((bucket_id = 'recordings'::text) AND (auth.role() = 'student'::text)) | -| 74045 | storage | objects | Áudios públicos | r | (bucket_id = 'phonics-audio'::text) | | \ No newline at end of file + WHERE ((s.id = ((storage.foldername(objects.name))[1])::uuid) AND (s.student_id = auth.uid()))))) | null | +| 53426 | storage | objects | Permitir deleção pelo dono do arquivo | d | ((bucket_id = 'recordings'::text) AND ((storage.foldername(name))[1] = (auth.uid())::text)) | null | +| 52099 | storage | objects | Permitir download público | r | (bucket_id = 'recordings'::text) | null | +| 37572 | storage | objects | Permitir update pela edge function | w | (bucket_id = 'story-images'::text) | null | +| 43939 | storage | objects | Permitir upload de áudios autenticado | a | null | ((bucket_id = 'recordings'::text) AND (auth.role() = 'authenticated'::text)) | +| 37571 | storage | objects | Permitir upload pela edge function | a | null | (bucket_id = 'story-images'::text) | +| 29716 | storage | objects | Students can upload their recordings | a | null | ((bucket_id = 'recordings'::text) AND (auth.role() = 'student'::text)) | +| 74045 | storage | objects | Áudios públicos | r | (bucket_id = 'phonics-audio'::text) | null | \ No newline at end of file diff --git a/supabase/functions/generate-story/index.ts b/supabase/functions/generate-story/index.ts index 7081bad..ce999d6 100644 --- a/supabase/functions/generate-story/index.ts +++ b/supabase/functions/generate-story/index.ts @@ -34,6 +34,7 @@ interface StoryPayload { const ALLOWED_ORIGINS = [ 'http://localhost:5173', // Vite dev server + 'http://localhost', // Vite dev server 'http://localhost:3000', // Caso use outro port 'https://leiturama.ai', // Produção 'https://leiturama.netlify.app' @@ -71,6 +72,7 @@ serve(async (req) => { 'Access-Control-Allow-Headers': 'authorization, x-client-info, apikey, content-type', 'Access-Control-Max-Age': '86400', // 24 horas 'Cross-Origin-Embedder-Policy': 'credentialless' + }; // Preflight request @@ -142,7 +144,6 @@ serve(async (req) => { content: prompt } ], - store: true, response_format: { type: "json_schema", json_schema: { @@ -177,19 +178,22 @@ serve(async (req) => { keywords: { type: "array", items: { - type: "string" + type: "string", + description: "Palavras chaves da página" } }, phonemes: { type: "array", items: { - type: "string" + type: "string", + description: "Fonemas da página" } }, syllablePatterns: { type: "array", items: { type: "string", + description: "Padrões silábicos da página", enum: ["CV", "CVC", "CCVC"] } } @@ -206,10 +210,13 @@ serve(async (req) => { type: "object", properties: { targetAge: { - type: "number" + type: "number", + description: "Idade alvo da história" }, difficulty: { - type: "string" + type: "string", + description: "Dificuldade da história", + enum: ["easy", "medium", "hard"] }, exerciseWords: { type: "object", @@ -319,6 +326,7 @@ serve(async (req) => { return { text: page.text, + text_syllables: page.text_syllables, image: publicUrl.publicUrl, // Salvar apenas o caminho do arquivo image_path: fileName }; @@ -480,7 +488,7 @@ function buildPrompt(base: StoryPrompt, voice?: string) { - ${selectedLanguage.instructions} - Linguagem clara e envolvente - 3-8 páginas de conteúdo - - Cada página deve ter um texto curto, o mesmo texto separado em sílabas e uma sugestão para uma imagem + - Cada página deve ter um texto, o mesmo texto separado em sílabas e uma sugestão para uma imagem - Evitar conteúdo sensível ou inadequado - Incluir elementos de ${base.theme_id} - Ambientado em ${base.setting_id}