Data model

How HeadDB preserves IDs, taxonomy, submissions, roles, and audit history.

Catalog

  • heads owns the stable numeric ID, normalized texture hash, texture source, category, publication state, and removal audit fields.
  • texture_assets stores canonical head-only PNGs by SHA-256 for skins uploaded directly to HeadDB.
  • categories and tags store human-readable names with URL-safe slugs.
  • head_tags models the many-to-many taxonomy relationship.
  • head_redirects can preserve references when a future duplicate is merged into a canonical entry.

Workflow and access

  • submissions stores the proposed data, texture value, current state, Discord delivery result, reviewer, notes, and approved head ID.
  • site_roles grants submitter, moderator, or administrator capabilities to OAuth users.
  • Better Auth owns its user, session, identity-account, and verification tables.

Audit and synchronization

  • moderation_events is an append-only record of moderation actions and their structured details.
  • catalog_revisions gives each published catalog change a monotonic revision number.

Foreign keys prevent dangling taxonomy and redirect records. Texture hashes are unique, but removed rows retain that uniqueness so an old texture cannot silently return under a new ID.