gohorsejobs/backend/migrations/036_create_company_followers.sql
GoHorse Deploy ae475e41a9 feat: implement careerjet gap analysis improvements
- Video Interview system (backend + frontend)
- Date Posted filter (24h, 7d, 30d)
- Company filter in jobs listing
- Recent searches persistence (LocalStorage)
- Job Alerts with email confirmation
- Favorite jobs with API
- Company followers system
- Careerjet URL compatibility (s/l aliases)
2026-02-14 19:37:25 +00:00

15 lines
707 B
SQL

-- Migration: Create company_followers table
-- Description: Table for users following companies
CREATE TABLE IF NOT EXISTS company_followers (
id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
user_id UUID NOT NULL REFERENCES users(id) ON DELETE CASCADE,
company_id UUID NOT NULL REFERENCES companies(id) ON DELETE CASCADE,
created_at TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT NOW(),
UNIQUE(user_id, company_id)
);
CREATE INDEX IF NOT EXISTS idx_company_followers_user_id ON company_followers(user_id);
CREATE INDEX IF NOT EXISTS idx_company_followers_company_id ON company_followers(company_id);
COMMENT ON TABLE company_followers IS 'Users following companies for job notifications';