| ▲ | grebc 7 hours ago | ||||||||||||||||||||||||||||||||||||||||
I’ve never once had to change a column definition. Sure in theory that option is available. Better option is to just add a new column with the correct definition then copy over existing data in the old column. 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. | |||||||||||||||||||||||||||||||||||||||||
| ▲ | stanac 7 hours ago | parent [-] | ||||||||||||||||||||||||||||||||||||||||
> 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. | |||||||||||||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||||||||||||