Enter your project credentials — saved in this browser.
First time? Run this SQL in Supabase → SQL Editor:
CREATE TABLE jusha_tabs (
id uuid PRIMARY KEY DEFAULT gen_random_uuid(),
name text NOT NULL,
icon text DEFAULT '💵',
color text DEFAULT '#3B82F6',
sort_order int DEFAULT 0,
created_at timestamptz DEFAULT now()
);
CREATE TABLE jusha_transactions (
id uuid PRIMARY KEY DEFAULT gen_random_uuid(),
tab_id uuid REFERENCES jusha_tabs(id) ON DELETE CASCADE,
type text CHECK (type IN ('in','out')),
amount numeric NOT NULL,
note text,
category text,
receipt_url text,
created_at timestamptz DEFAULT now()
);
ALTER TABLE jusha_tabs ENABLE ROW LEVEL SECURITY;
ALTER TABLE jusha_transactions ENABLE ROW LEVEL SECURITY;
CREATE POLICY "All" ON jusha_tabs FOR ALL USING (true) WITH CHECK (true);
CREATE POLICY "All" ON jusha_transactions FOR ALL USING (true) WITH CHECK (true);
-- Storage bucket for receipts
INSERT INTO storage.buckets (id,name,public)
VALUES ('jusha-receipts','jusha-receipts',true) ON CONFLICT DO NOTHING;
CREATE POLICY "All storage" ON storage.objects
FOR ALL USING (bucket_id='jusha-receipts') WITH CHECK (bucket_id='jusha-receipts');