feat: commit remaining service files, migrations, and model updates
- gateway, companies, customers, job_seekers apps updated
- users config/mod/mail handlers
- auth middleware and jwt crate updates
- db models: user, config, mod updates
- all remaining migrations: portfolio, notifications, reviews, kb, support, coupons, onboarding states
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-18 22:59:47 +01:00
|
|
|
-- Reviews: customers leave reviews on professionals after an accepted lead
|
|
|
|
|
CREATE TABLE IF NOT EXISTS reviews (
|
|
|
|
|
id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
|
|
|
|
|
lead_request_id UUID NOT NULL REFERENCES lead_requests(id) ON DELETE CASCADE UNIQUE,
|
2026-03-22 15:55:29 +01:00
|
|
|
customer_id UUID NOT NULL REFERENCES customer_profiles(id) ON DELETE CASCADE,
|
feat: commit remaining service files, migrations, and model updates
- gateway, companies, customers, job_seekers apps updated
- users config/mod/mail handlers
- auth middleware and jwt crate updates
- db models: user, config, mod updates
- all remaining migrations: portfolio, notifications, reviews, kb, support, coupons, onboarding states
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-18 22:59:47 +01:00
|
|
|
professional_id UUID NOT NULL REFERENCES professionals(id) ON DELETE CASCADE,
|
|
|
|
|
rating SMALLINT NOT NULL CHECK (rating >= 1 AND rating <= 5),
|
|
|
|
|
comment TEXT,
|
|
|
|
|
is_published BOOLEAN NOT NULL DEFAULT true,
|
|
|
|
|
created_at TIMESTAMPTZ NOT NULL DEFAULT NOW(),
|
|
|
|
|
updated_at TIMESTAMPTZ NOT NULL DEFAULT NOW()
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
CREATE INDEX IF NOT EXISTS idx_reviews_professional_id ON reviews(professional_id);
|
|
|
|
|
CREATE INDEX IF NOT EXISTS idx_reviews_customer_id ON reviews(customer_id);
|