Skip to content

The badges in the database

tilttek/badges-bundle
TableOne row perColumns
tilttek_badges_contributionbadge, path and activitybadge, path, activity, member, quantity, occurred_at
tilttek_badges_awardmember, badge and numberbadge, member, number, awarded_at, cause, manual
tilttek_badges_profilemember who shows a badgemember, shown (JSON), featured (JSON), title
tilttek_badges_grantmember and applicationmember, client, granted_at

A contribution, an award or a consent is inserted by a statement that writes nothing when its row is already there, without aborting the surrounding transaction: ON CONFLICT DO NOTHING on PostgreSQL, INSERT IGNORE on MySQL and MariaDB, INSERT OR IGNORE on SQLite. On another platform, a plain insertion lets the unique violation of a race reach the caller. A cancellation reads and deletes the activity's contributions in one transaction; a profile is replaced in one transaction. Dates are written in UTC, to the second.

Members are written as their references, member:44, up to 320 bytes.