Re:SQLite in Production: Optimizing WAL Mode, Concurrency, a...
by stanac on Wednesday July 29, 2026 @06:13AM
(#49095464)
> Better option is to just add a new column with the correct definition
After that you won't be able to change column to NOT NULL. You would need migration to create new table with not null column, copy everything, drop old table and rename the new one.
Edit: unless the table is empty.
Re:SQLite in Production: Optimizing WAL Mode, Concurrency, a...
by yomismoaqui on Wednesday July 29, 2026 @06:53AM
(#49095754)
Wrong, you can change NOT NULL since 3.53:
Re:SQLite in Production: Optimizing WAL Mode, Concurrency, a...
by stanac on Wednesday July 29, 2026 @06:56AM
(#49095789)
Released a month ago, thanks, didn't know.
Re:SQLite in Production: Optimizing WAL Mode, Concurrency, a...
by grebc on Wednesday July 29, 2026 @06:22AM
(#49095534)
How do you migrate in place data that doesn’t convert between types while maintaining a strict condition like NOT NULL?
This is again a scenario I’ve never run into 20ish years of SQL.
Re:SQLite in Production: Optimizing WAL Mode, Concurrency, a...
by stanac on Wednesday July 29, 2026 @06:57AM
(#49095800)
You create a nullable column and then change it to not null. Which wasn't possible in SQLite until recently.
I don’t think that’s really a positive or negative.
And the point about migrations ideally being separate is really just your own opinion. I prefer having the database definition in the same source tree as the application, ideally just a .sql file in the project.