KamoCRM

State the company phone column defaults where IF NOT EXISTS cannot swallow them

FixInitializerService
Shipped
27 ஆகஸ்ட், 2026 அன்று 8:30 PM UTC
Author
Kamo
Commit
fa48d03

The 2026-08-27 run proved the ADD COLUMN ... DEFAULT FALSE never applied: ddl-auto builds the SessionFactory before any CommandLineRunner, so Hibernate had already added both columns — without a default, as it always does — and IF NOT EXISTS then skipped the whole statement, DEFAULT clause included. Both landed with column_default = NULL. Say it as its own ALTER COLUMN ... SET DEFAULT, which nothing can swallow, so a later raw INSERT that omits the column still gets FALSE. The backfill was already doing the part that matters and is unchanged; the single existing row reads FALSE on both columns. No behaviour change either way — every reader treats NULL as "not set" and falls back to off-by-default, and Hibernate names both columns in every INSERT. The comment claimed otherwise, which is the thing actually worth fixing.

All changes

Like what you see shipping?

All of it arrives in your workspace on its own. Start on the free plan and read this page again in a month.

Start Free ForeverView Pricing