Files
AstralRinth/apps/labrinth/migrations/20250823233518_user-compliance.sql
François-Xavier Talbot 006b19e3c9 Creator tax compliance (#4254)
* Initial implementation

* Remove test code

* Query cache

* Appease clippy

* Precise TIN/SSN

* Make tax threshold customizable via env variable

* Address review comments
2025-08-25 16:34:58 +00:00

17 lines
576 B
SQL

CREATE TABLE users_compliance (
id BIGSERIAL PRIMARY KEY,
user_id BIGINT NOT NULL REFERENCES users(id),
requested TIMESTAMP WITH TIME ZONE NOT NULL,
signed TIMESTAMP WITH TIME ZONE,
e_delivery_consented BOOLEAN NOT NULL,
tin_matched BOOLEAN NOT NULL,
last_checked TIMESTAMP WITH TIME ZONE NOT NULL,
external_request_id VARCHAR NOT NULL,
reference_id VARCHAR NOT NULL,
form_type VARCHAR NOT NULL,
UNIQUE (user_id)
);