-
-
Notifications
You must be signed in to change notification settings - Fork 150
docs: add Supabase schema and seed instructions #309
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from 1 commit
f72a2bb
630bcf7
0d9e42f
db913a6
8dd5227
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -182,21 +182,48 @@ uvicorn main:app --reload | |
|
|
||
| To populate the database with initial data, follow these steps: | ||
|
|
||
| 1. **Open Supabase Dashboard** | ||
|
|
||
| - Go to [Supabase](https://supabase.com/) and log in. | ||
| 1. **Open Supabase Dashboard** | ||
| - Go to https://supabase.com/ and log in. | ||
| - Select your created project. | ||
|
|
||
| 2. **Access the SQL Editor** | ||
|
|
||
| - In the left sidebar, click on **SQL Editor**. | ||
|
|
||
| 3. **Run the SQL Script** | ||
| 3. **Create Required Tables** | ||
| - Run the following SQL in the Supabase SQL Editor: | ||
|
|
||
| ```sql | ||
| -- 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() | ||
| ); | ||
|
coderabbitai[bot] marked this conversation as resolved.
Outdated
|
||
|
|
||
| -- 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; | ||
| ``` | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Current step order reintroduces duplicate-key failures during onboarding. Step 3 seeds Proposed doc fix-3. **Create Required Tables**
+3. **Create Required Tables**
- Run the following SQL in the Supabase SQL Editor:
@@
- -- 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;
+ -- Create schema only (no seed here)
@@
-4. **Run the SQL Script**
+4. **Run the SQL Script (initial data)**Alternative: keep Step 3 seed, but then Also applies to: 218-221 🤖 Prompt for AI Agents |
||
|
|
||
|
|
||
| 4. **Run the SQL Script** | ||
|
coderabbitai[bot] marked this conversation as resolved.
Outdated
|
||
| - Open the `sql.txt` file in your project. | ||
| - Copy the SQL queries from the file. | ||
| - Paste the queries into the SQL Editor and click **Run**. | ||
|
|
||
| This will populate the database with the required initial data for the platform. 🚀 | ||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
| --- | ||
|
|
||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.