-
Notifications
You must be signed in to change notification settings - Fork 144
Description
Is this related to an existing part of the documentation?
- Yes, it is related to an existing section
What needs to be updated?
📌 Current Documentation Issue
The database schema and initial data seeding scripts are missing from the documentation, leading to "relation does not exist" errors during initial setup.
✨ Proposed Changes
Add the following SQL schema definition and seed data to the setup instructions to ensure all tables and relationships are correctly established before data insertion :
`-- Create Tables (Schema)
CREATE TABLE public.users (
id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
username TEXT UNIQUE NOT NULL,
email TEXT UNIQUE NOT NULL,
role TEXT,
profile_image TEXT,
bio TEXT,
created_at TIMESTAMP WITH TIME ZONE DEFAULT NOW()
);
-- Seed Initial Data
INSERT INTO public.users (username, email, role, bio)
VALUES
('creator1', 'creator1@example.com', 'creator', 'Bio of creator1'),
('brand1', 'brand1@example.com', 'brand', 'Bio of brand1')
ON CONFLICT (username) DO NOTHING;`
📋 Additional Context
Ensuring that the users table is created in the public schema is critical for preventing 42P01 errors. The use of ON CONFLICT prevents duplicate key violations during repeated setup runs.
Relevant Documentation Link (if any)
No response
Record
- I agree to follow this project's Code of Conduct
- I want to work on this update