Skip to content
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

update 1 #45

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open

update 1 #45

wants to merge 2 commits into from

Conversation

adrianpuiu
Copy link

Extension Creation: Added CREATE EXTENSION IF NOT EXISTS vector; to ensure the vector extension is enabled only if it's not already present.

Table Creation: Utilized CREATE TABLE IF NOT EXISTS to prevent errors if the site_pages table already exists.

Index Creation: Since PostgreSQL doesn't support CREATE INDEX IF NOT EXISTS, we employed a DO $$ ... $$; block to check for the existence of each index before attempting to create it.

Function Creation: Included DROP FUNCTION IF EXISTS before the CREATE FUNCTION statement to ensure that any existing match_site_pages function is removed prior to defining the new one.

Row-Level Security: Ensured that Row-Level Security is enabled and a policy is set to allow public read access.

These adjustments aim to make the script idempotent, meaning it can be run multiple times without causing errors due to existing objects, and compatible with Supabase's security features.

Extension Creation: Added CREATE EXTENSION IF NOT EXISTS vector; to ensure the vector extension is enabled only if it's not already present.

Table Creation: Utilized CREATE TABLE IF NOT EXISTS to prevent errors if the site_pages table already exists.

Index Creation: Since PostgreSQL doesn't support CREATE INDEX IF NOT EXISTS, we employed a DO $$ ... $$; block to check for the existence of each index before attempting to create it.

Function Creation: Included DROP FUNCTION IF EXISTS before the CREATE FUNCTION statement to ensure that any existing match_site_pages function is removed prior to defining the new one.

Row-Level Security: Ensured that Row-Level Security is enabled and a policy is set to allow public read access.

These adjustments aim to make the script idempotent, meaning it can be run multiple times without causing errors due to existing objects, and compatible with Supabase's security features.
@coleam00 coleam00 added the enhancement New feature or request label Mar 9, 2025
@coleam00
Copy link
Owner

coleam00 commented Mar 9, 2025

These are important changes! But it looks like you might have updated the wrong file? SQL shouldn't be in utils.py

@coleam00 coleam00 added the invalid This doesn't seem right label Mar 9, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request invalid This doesn't seem right
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants