# Published

> The publish flag — a boolean specialised for the one field nearly every entity has.

Source: CBX documentation, version 4.0 preview (unreleased). Canonical page: https://docs.configbox.at/docs/4.0-preview/technical/property-types/published. Last updated 2026-07-27.

---
The publish flag — a [`boolean`](https://docs.configbox.at/docs/4.0-preview/technical/property-types/boolean) specialised for the one field nearly every entity has.

**Storage kind:** `column` · **Column:** `varchar(1)`

Use it for the field that decides whether a record is live, and only for that: one per model, named
`published` by convention. Any other yes/no is a plain [`boolean`](https://docs.configbox.at/docs/4.0-preview/technical/property-types/boolean) — a second `published`
property on one model gives you two toggles in the list and no way to tell them apart.

## Settings

| Setting | Meaning |
|---|---|
| `default` | Usually `1` — a newly created record is normally live |

## What it adds over `boolean`

- **A toggle in the list.** The cell renders a check-circle or ban icon carrying
  `trigger-toggle-record-activation` and the record id, so a record can be published or unpublished
  from the list without opening it.
- **A filter**, and the conventional `CBYES` / `CBNO` labels.

Everything else — the `varchar(1)` column, the `'0'`/`'1'` values, the string-comparison rule for
hand-written SQL — is the same as `boolean`.

Note that the toggle is rendered unconditionally by this type, whereas the *filter* still needs
`addDropdownFilter` in the definition like any other property.

## The column is usually indexed

Published state is in the WHERE clause of most reads, so these columns carry an index. That is worth
knowing before changing the type: an indexed column cannot be widened past InnoDB's key limit, which
is why `3.6.5` left indexed columns alone and recorded their real width as an explicit `dataType`
instead of migrating them.

Declare `'default' => 1` unless there is a reason new records should start hidden. Whichever you
choose, declare it — the same reasoning as for `boolean`: without a default the column can end up
nullable and holding neither value.

@see boolean.md
