-
-
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 2 commits
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,40 @@ 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 Supabase Dashboard (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 | ||
| -- Enable pgcrypto extension for gen_random_uuid() support | ||
| CREATE EXTENSION IF NOT EXISTS "pgcrypto"; | ||
|
|
||
| -- Create Tables (Schema) | ||
| CREATE TABLE IF NOT EXISTS public.users ( | ||
| id UUID PRIMARY KEY DEFAULT gen_random_uuid(), | ||
|
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. π§© Analysis chainπ Script executed: #!/bin/bash
# Description: Check how the backend model interacts with the id column type
# Search for UUID type handling in models and database interactions
rg -n -C3 'Column\(String.*id|UUID|gen_random_uuid' Backend/app/models/
# Check if there are any explicit type casts or UUID handling
rg -n -C3 'uuid|UUID' Backend/app/ --type pyRepository: AOSSIE-Org/InPactAI Length of output: 16595 π Script executed: # Check the README.md file around line 202 to see the schema documentation
sed -n '190,215p' README.md | cat -nRepository: AOSSIE-Org/InPactAI Length of output: 1006 Align backend UUID type with documented PostgreSQL schema. The README.md documents the database schema using PostgreSQL's native π€ Prompt for AI Agents |
||
| username TEXT UNIQUE NOT NULL, | ||
| email TEXT UNIQUE NOT NULL, | ||
| role TEXT NOT NULL, | ||
| profile_image TEXT, | ||
| bio TEXT, | ||
| is_online BOOLEAN DEFAULT FALSE, | ||
| last_seen TIMESTAMP WITH TIME ZONE, | ||
| created_at TIMESTAMP WITH TIME ZONE DEFAULT NOW() | ||
| ); | ||
| ``` | ||
|
|
||
| 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. π | ||
| - The script includes conflict handling to avoid duplicate entries based on unique constraints. | ||
|
coderabbitai[bot] marked this conversation as resolved.
Outdated
|
||
|
|
||
| --- | ||
|
|
||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.