Skip to content

DOCS UPDATE: Insert Table Instructions on supabase #285

Description

@eyescratcher22

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions