Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

BUG: Fix SQL schema issues (USER-DEFINED, FK order, duplicate blocks, triggers) + missing SUPABASE_JWT_SECRET in .env.example

Aperta
#191 1 commento 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
45/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Ferma
Stack tecnologico
postgresql, supabase
Ambito
backend, databases

Direzione di ricerca

Inizia eseguendo lo schema SQL fornito in Supabase o in un'istanza PostgreSQL locale e ispeziona le definizioni dello schema, l'ordine delle tabelle, le proposte duplicate e i blocchi dei trigger, i GRANT e .env.example. Il lavoro è completato quando lo schema viene applicato senza errori SQL o di autorizzazione, le definizioni duplicate sono rimosse, le chiavi esterne vengono risolte e SUPABASE_JWT_SECRET è presente.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

Is there an existing issue for this?
  • I have searched the existing issues
What happened?

📌 Issue Overview

While setting up the project locally, several schema-related issues cause SQL migrations to fail and the local environment to become unusable without manual fixes. In addition, one required environment variable (SUPABASE_JWT_SECRET) is missing from .env.example.

This makes the project difficult to set up for contributors.

🔍 Steps to Reproduce

  1. Clone the repository
  2. Run the provided SQL schema in Supabase or a local PostgreSQL instance
  3. Attempt to run the app using .env.example
  4. Observe multiple SQL errors and a runtime permission error

🎯 Expected Behavior

  • Schema should apply cleanly without manual corrections
  • No duplicate table or trigger definitions
  • Foreign key references should resolve in proper order
  • Enum types should be valid PostgreSQL types
  • .env.example should include all required variables
  • Local environment should work without “permission denied” errors

🚨 Actual Behavior

  1. Invalid Enum Type Usage**

Several tables use this invalid syntax:

status USER-DEFINED DEFAULT 'value'::some_enum

This causes:

ERROR: syntax error at or near "USER"
2. Duplicate Table / Trigger Definitions
  • proposals table is defined twice

  • update_proposals_updated_at function + trigger are defined twice
    Causes:

ERROR: trigger "update_proposals_updated_at" already exists
3. Incorrect Table Creation Order

Some tables reference others before they exist. Example:

FOREIGN KEY (user_id) REFERENCES public.profiles(id)

but public.profiles is created later.
Causes:

ERROR: relation "public.profiles" does not exist
4. Permission Errors After Schema Load

After migrations succeed, creating a profile fails with:

permission denied for schema public

GRANT statements appear to be missing for anon, authenticated, and service_role.

5. Missing Required Env Variable

.env.example is missing:

SUPABASE_JWT_SECRET=

This prevents the local app from running correctly.

📷 Screenshot

(Not included here, but can be added if maintainers want visual logs.)

💡 Suggested Improvements

  1. Replace all USER-DEFINED placeholders with the actual enum types (application_status, invite_status, payment_status, deal_status).

  2. Remove duplicate proposals table + duplicate trigger/function definitions.

  3. Reorder tables so referenced tables exist before foreign keys are applied.

  4. Add missing permissions back to the schema setup:

    GRANT USAGE ON SCHEMA public TO anon, authenticated, service_role;
    GRANT ALL ON ALL TABLES IN SCHEMA public TO service_role;
    
  5. Add missing variable to .env.example:

    SUPABASE_JWT_SECRET=
    

I’m willing to submit a PR addressing these issues.

Record
  • I agree to follow this project's Code of Conduct
  • I want to work on this issue
Lingua principale
TypeScript
Stelle
102
Fork
144
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Preparare l'ambiente

  • Nessun Dockerfile né file Docker Compose
  • Ha un modello di pull request
  • Nessuna guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di AOSSIE-Org/InPactAI

Tutte le issue di AOSSIE-Org/InPactAI

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.