Skip to content

Feat/phase 2 supabase migration - #2

Merged
Aditya2550 merged 3 commits into
mainfrom
feat/phase-2-supabase-migration
Jul 6, 2026
Merged

Aditya2550 merged 3 commits into
mainfrom
feat/phase-2-supabase-migration

Conversation

@Aditya2550

Copy link
Copy Markdown
Owner

Phase 2: supabase migration, SSL config and schema fixes done

Copilot AI review requested due to automatic review settings July 6, 2026 12:25
@Aditya2550
Aditya2550 merged commit 8ab395a into main Jul 6, 2026
1 check passed

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR continues the Phase 2 Supabase migration by moving parts of the approvals/notifications schema to UUIDs, updating the Postgres connection to use SSL, and refreshing the backend .env template for Supabase connectivity.

Changes:

  • Update 003_init_approvals.sql to use UUID primary/foreign keys for approvals- and notifications-related tables.
  • Configure pg Pool connection to enable SSL.
  • Update .env.example with a Supabase-style DATABASE_URL example.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 4 comments.

File Description
backend/src/db/migrations/003_init_approvals.sql Switch approvals/notifications IDs and FKs to UUIDs for Supabase alignment.
backend/src/config/db.js Enable SSL in the Postgres connection pool.
backend/.env.example Provide a Supabase pooler DATABASE_URL example.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread backend/.env.example
FRONTEND_URL=http://localhost:5173
JWT_SECRET=change_me
DATABASE_URL=postgresql://postgres:your_password@localhost:5432/reimbursement
DATABASE_URL=DATABASE_URL=postgresql://postgres.[project-ref]:[password]@aws-1-ap-south-1.pooler.supabase.com:5432/postgres
Comment thread backend/src/config/db.js
Comment on lines +5 to +8
export const pool = new Pool({
connectionString: env.DATABASE_URL,
ssl: { rejectUnauthorized: false },
});
Comment on lines 1 to 5
CREATE TABLE IF NOT EXISTS approval_rules (
id SERIAL PRIMARY KEY,
id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
rule_json JSONB NOT NULL,
manager_first_enabled BOOLEAN DEFAULT TRUE,
created_at TIMESTAMP DEFAULT NOW()
Comment on lines 8 to +13
CREATE TABLE IF NOT EXISTS expense_approval_steps (
id SERIAL PRIMARY KEY,
expense_id INT REFERENCES expenses(id),
id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
expense_id UUID REFERENCES expenses(id),
step_no INT NOT NULL,
approver_role VARCHAR(20),
approver_id INT,
approver_id UUID,
@Aditya2550
Aditya2550 deleted the feat/phase-2-supabase-migration branch July 8, 2026 18:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants