Files
pages/apps/labrinth/migrations/20250914190749_affiliate_codes.sql
aecsocket 4def0e8407 Initial affiliate codes implementation (#4382)
* Initial affiliate codes implementation

* some more docs to codes

* sqlx prepare

* Address PR comments

* Address more PR comments

* fix clippy

* Switch to using Json<T> for type-safe responses
2025-09-18 15:43:34 +00:00

10 lines
378 B
SQL

CREATE TABLE affiliate_codes (
id bigint PRIMARY KEY,
created_at timestamptz NOT NULL DEFAULT CURRENT_TIMESTAMP,
created_by bigint NOT NULL REFERENCES users(id),
affiliate bigint NOT NULL REFERENCES users(id),
-- left nullable so we can explicitly set payouts if we need to,
-- and use a global default if unset
revenue_split float
);