logoalt Hacker News

stanactoday at 10:13 AM2 repliesview on HN

> 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.


Replies

yomismoaquitoday at 10:53 AM

Wrong, you can change NOT NULL since 3.53:

https://sqlite.org/releaselog/3_53_3.html

show 1 reply
grebctoday at 10:22 AM

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.

show 1 reply