Ithibati.Bootstrap (Ithibati v0.6.2)

Copy Markdown View Source

Stores the one-time bootstrap claim and the account that made it.

A unique index on :claimed permits one claim through Ithibati.Identity.Instance.claim/2. The row belongs to Ithibati so its migration maintains that constraint.

Deleting the account nulls user_id while preserving the claim. Initial setup therefore stays closed after the first account is removed. Use Ithibati.Identity.Instance to read or claim this state.

Summary

Functions

Builds a bootstrap changeset with the account reference and database constraints.

Functions

changeset(bootstrap, attrs)

Builds a bootstrap changeset with the account reference and database constraints.

This function does not insert the row. An insert can report a unique-constraint error on :claimed or a foreign-key error on :user_id. Application registration flows should use Ithibati.Identity.Instance.claim/2 to handle these within their transaction.