Files
member-console/internal/entitlements/queries/numeric_entitlement_contributions.sql
T
cgalo5758 b0072d8971 Consolidate domain tables into core schema
Squash the pre-production migration history into fresh core, fedwiki,
and stripe baselines and reduce the canonical source list to those
three streams.

Update sqlc configs, generated queries, raw SQL, tests, and docs while
keeping provider tables schema-qualified.

BREAKING: existing local database volumes must be wiped because goose
version history restarts from the new baselines.
2026-07-05 20:10:23 -05:00

14 lines
484 B
SQL

-- name: CreateNumericEntitlementContribution :one
INSERT INTO core.numeric_entitlement_contributions (entitlement_id, provision_id, contributed_value, stacking_policy)
VALUES ($1, $2, $3, $4)
RETURNING *;
-- name: DeleteContributionsByProvisionID :exec
DELETE FROM core.numeric_entitlement_contributions
WHERE provision_id = $1;
-- name: ListContributionsByEntitlementID :many
SELECT * FROM core.numeric_entitlement_contributions
WHERE entitlement_id = $1
ORDER BY created_at ASC;