From 8fa99b6d4cc85a450cd951c76069f8068056d95c Mon Sep 17 00:00:00 2001 From: Aidan Traboulay Date: Sun, 15 Dec 2024 16:32:57 -0400 Subject: [PATCH] add owner id --- backend/.sqlc/migrations/20241215194302_initial_schema.sql | 2 ++ 1 file changed, 2 insertions(+) diff --git a/backend/.sqlc/migrations/20241215194302_initial_schema.sql b/backend/.sqlc/migrations/20241215194302_initial_schema.sql index eca810a7..130b2932 100644 --- a/backend/.sqlc/migrations/20241215194302_initial_schema.sql +++ b/backend/.sqlc/migrations/20241215194302_initial_schema.sql @@ -37,6 +37,7 @@ CREATE TABLE IF NOT EXISTS verify_email_tokens ( CREATE TABLE IF NOT EXISTS companies ( id uuid PRIMARY KEY DEFAULT gen_random_uuid(), + owner_id uuid NOT NULL REFERENCES users(id), name varchar NOT NULL, wallet_address varchar, linkedin_url varchar NOT NULL, @@ -124,6 +125,7 @@ CREATE TABLE IF NOT EXISTS transactions ( ); CREATE INDEX IF NOT EXISTS idx_users_email ON users(email); +CREATE INDEX IF NOT EXISTS idx_companies_owner ON companies(owner_id); CREATE INDEX IF NOT EXISTS idx_projects_company ON projects(company_id); CREATE INDEX IF NOT EXISTS idx_project_answers_project ON project_answers(project_id); CREATE INDEX IF NOT EXISTS idx_transactions_project ON transactions(project_id);