Table: ideas

Properties:

Property Data Type (Postgres) Notes
ID uuid Unique identifier (default: gen_random_uuid()).
Title text Required, main title field.
Description text Required.
Category text Required (e.g. Startup, Tech, Health, etc.).
Author uuid (FK → users.id) Relation to Users database (matches Supabase auth.users).
AI Rating double precision Required, decimal rating.
AI Feedback text Optional.
Votes integer Required, default = 0.
Has Voted boolean Required, default = false.
Created At timestamp without time zone Auto-set when record is created (Postgres style).
Author Name text Optional (denormalized copy of author’s name).
Tagline text Optional short tagline.

Table: idea_votes

Property Data Type (Postgres) Notes
User ID UUID Required. Foreign key → auth.users.id.
Idea ID UUID Required. Foreign key → public.ideas.id.
Created At TIMESTAMP WITHOUT TIME ZONE Auto-set with now(). Useful for analytics (when the vote happened).
Primary Key (user_id, idea_id) Ensures a user can only vote once per idea.