create table if not exists public.feedback_submissions (
    id bigint generated by default as identity primary key,
    created_at timestamptz not null default timezone('utc', now()),
    input_sentence text not null,
    original_output text not null,
    corrected_output text not null,
    user_comment text not null default '',
    decode_mode text not null default '',
    review_status text not null default 'pending'
        check (review_status in ('pending', 'approved', 'rejected')),
    admin_notes text not null default '',
    source text not null default 'streamlit'
);

create index if not exists feedback_submissions_created_at_idx
    on public.feedback_submissions (created_at desc);

create index if not exists feedback_submissions_review_status_idx
    on public.feedback_submissions (review_status);
