fuck_microsoft_access/migrations/2026-01-13-095838-0000_clients/up.sql

22 lines
587 B
SQL

CREATE TABLE IF NOT EXISTS clients (
id BIGINT GENERATED ALWAYS AS IDENTITY PRIMARY KEY,
email TEXT NOT NULL UNIQUE,
first_name TEXT NOT NULL,
last_name TEXT NOT NULL,
date_of_birth DATE NOT NULL,
phone_number TEXT NOT NULL,
gov_id_number TEXT NOT NULL,
house_number TEXT NOT NULL,
address_line TEXT NOT NULL,
city TEXT NOT NULL,
state TEXT NOT NULL,
postal_code TEXT NOT NULL,
country TEXT NOT NULL,
worker_user_id BIGINT,
CONSTRAINT fk_worker_user_id FOREIGN KEY (worker_user_id) REFERENCES users(id) ON DELETE CASCADE
)