You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 659be05
Browse filesBrowse the repository at this point in the historyBrowse files
## What
BIT column defaults were stored and rendered incorrectly. A column such
as `BIT(1) DEFAULT '0'` (e.g., as produced by Ninja Forms) emitted an
invalid `SHOW CREATE TABLE` / dump line:
```sql
`maintenance` bit(1) DEFAULT '0'
```
MySQL does not accept a quoted-string default on a BIT column—the value
has to be a bit literal (`b'0'`) or a number (`0`). The invalid output
broke dump/restore flows (e.g., Studio → Pressable).
## Fix
Normalize BIT column default literals end to end:
- **Store:** Record BIT defaults in the information schema in a
normalized format (`b'...'`).
- **`SHOW CREATE TABLE`:** Emit the stored bit literal verbatim (`bit(1)
DEFAULT b'0'`).
- **Internal SQLite DDL / `column = DEFAULT`:** Render the bit literal
as the SQLite integer it maps to.
- **Legacy migration:** The information-schema reconstructor converts
integer BIT defaults into a bit literal.
## Tests
- `SHOW CREATE TABLE` output **and** the inserted/read-back values for
every default form (quoted string, integer, `b'…'`, `0b…`, `x'…'`,
`TRUE`, `FALSE`).
- `UPDATE … SET col = DEFAULT` on a BIT column.
- Reconstruction of BIT defaults for legacy databases.
- Full unit suite green; coding standards (PHPCS) pass.
0 commit comments