fix: restore profile verification schema

This commit is contained in:
2026-08-26 15:57:53 +03:00
parent b527791a10
commit 4a4b1d89e3
11 changed files with 94 additions and 10 deletions

View File

@@ -0,0 +1,17 @@
ALTER TABLE employees
ADD COLUMN IF NOT EXISTS profile_unavailable_streak INTEGER NOT NULL DEFAULT 0;
ALTER TABLE employees
ADD COLUMN IF NOT EXISTS last_profile_check_at TIMESTAMPTZ;
CREATE TABLE IF NOT EXISTS employee_profile_urls (
id SERIAL PRIMARY KEY,
employee_id INTEGER NOT NULL REFERENCES employees(id) ON DELETE CASCADE,
url TEXT NOT NULL,
first_seen_at TIMESTAMPTZ NOT NULL DEFAULT now(),
last_seen_at TIMESTAMPTZ NOT NULL DEFAULT now(),
CONSTRAINT uq_employee_profile_urls_employee_url UNIQUE (employee_id, url)
);
CREATE INDEX IF NOT EXISTS ix_employee_profile_urls_employee_id
ON employee_profile_urls (employee_id);