forked from didirus/AstralRinth
* 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
10 lines
378 B
SQL
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
|
|
);
|