One page or entity an agent changeset changes, with its full staged state. Reads of the staged state overlay these rows on the live content; publishing writes after_snapshot back, pages through the same page save the CMS uses. Rows are removed when a later call stages the entity back to its base state or the user discards the entity. No deleted_at: a row is the current staged state, so it is deleted outright, and agent_changeset_call_entities keeps the history.
| Name | Type | Default | Nullable | Children | Parents | Comment |
|---|---|---|---|---|---|---|
| after_snapshot | jsonb | true | The staged entity in the snapshot shape of entity_type. Null for deletes. | |||
| base_snapshot | jsonb | true | The live entity, in the snapshot shape of entity_type, when it was first staged. Publishing is rejected if the live entity no longer matches it. Null for creates. | |||
| changeset_id | uuid | false | public.agent_changesets | The changeset this entity belongs to. | ||
| created_at | timestamp with time zone | now() | false | Timestamp when the record was created. | ||
| entity_id | uuid | false | Id of the live entity. For a create, the id the server assigned when staging, which publishing keeps. | |||
| entity_type | content_entity_type | false | Which table entity_id points to, and which snapshot shape the snapshots have. | |||
| id | uuid | uuid_generate_v4() | false | A unique, stable identifier for the record. | ||
| label | text | false | What people call the entity: the page title, chapter, module or course name, glossary term or citation key of after_snapshot, or of base_snapshot for deletes. Kept so that listings need not read the snapshots. | |||
| revision | integer | false | The changeset revision of the last write to this row. A write call is refused if the row changed after the call read it, so parallel calls never overwrite each other. | |||
| risk_reasons | jsonb | ‘[]’::jsonb | false | Why publishing this entity needs the user’s confirmation on the review page, as an array of {code, …facts}: the rule each reason breaks and the facts that rule found. Empty for routine changes. | ||
| updated_at | timestamp with time zone | now() | false | Timestamp when the record was last updated. The field is updated automatically by the set_timestamp trigger. |
| Name | Definition |
|---|---|
| AI agent changesets | How a teacher’s AI agent edits course material through the MCP server without touching what students see. Every agent write is staged in the teacher’s open changeset for the course and reaches students only when the changeset is published; each call is logged with what it changed so that it can be reverted, and saves from the web UI and agents alike leave history. |
| Name | Type | Definition |
|---|---|---|
| agent_changeset_entities_changeset_id_fkey | FOREIGN KEY | FOREIGN KEY (changeset_id) REFERENCES agent_changesets(id) |
| agent_changeset_entities_changeset_id_not_null | n | NOT NULL changeset_id |
| agent_changeset_entities_created_at_not_null | n | NOT NULL created_at |
| agent_changeset_entities_entity_id_not_null | n | NOT NULL entity_id |
| agent_changeset_entities_entity_type_not_null | n | NOT NULL entity_type |
| agent_changeset_entities_has_snapshot | CHECK | CHECK (((base_snapshot IS NOT NULL) OR (after_snapshot IS NOT NULL))) |
| agent_changeset_entities_id_not_null | n | NOT NULL id |
| agent_changeset_entities_label_not_null | n | NOT NULL label |
| agent_changeset_entities_pkey | PRIMARY KEY | PRIMARY KEY (id) |
| agent_changeset_entities_revision_not_null | n | NOT NULL revision |
| agent_changeset_entities_risk_reasons_array | CHECK | CHECK ((jsonb_typeof(risk_reasons) = ‘array’::text)) |
| agent_changeset_entities_risk_reasons_not_null | n | NOT NULL risk_reasons |
| agent_changeset_entities_unique_entity | UNIQUE | UNIQUE (changeset_id, entity_type, entity_id) |
| agent_changeset_entities_updated_at_not_null | n | NOT NULL updated_at |
| Name | Definition |
|---|---|
| agent_changeset_entities_pkey | CREATE UNIQUE INDEX agent_changeset_entities_pkey ON public.agent_changeset_entities USING btree (id) |
| agent_changeset_entities_unique_entity | CREATE UNIQUE INDEX agent_changeset_entities_unique_entity ON public.agent_changeset_entities USING btree (changeset_id, entity_type, entity_id) |
| idx_agent_changeset_entities_entity | CREATE INDEX idx_agent_changeset_entities_entity ON public.agent_changeset_entities USING btree (entity_type, entity_id) |
| Name | Definition |
|---|---|
| set_timestamp | CREATE TRIGGER set_timestamp BEFORE UPDATE ON public.agent_changeset_entities FOR EACH ROW EXECUTE FUNCTION trigger_set_timestamp() |
Generated by tbls