Feature #12167
openEnable setting of a Default Value for Dbo fields
0%
Description
Adding this would enable automatic update for Tables that already have Data
I Build a "Wt" Way to update SQL Tables in which I scan the generated SQL against previous versions. Then I remove all colums of a table that are already present in the older ones.
The Rest can be added with strict sql and as long as the table is empty, everything works.
If new columns are set as optional, this also works.
But as soon as the first row is filled in, updating failed as no default is given.
Adding a default, that shows up in the sql would fix that immediately =)
This might also help with generating info about the Application or Module Version to then update older info with new elements if needed.
Thanks
Updated by Matthias Van Ceulebroeck 5 months ago
- Target version set to future
Hello Christian,
I see your use-case. This is, however, a big undertaking, as it touches a lot of code. I will schedule this for the future, and still under some reservation.
For now, I would advise some external system to manage your database (structure). I have used flyway before, and think that's fairly decent. I know Liquibase is an alternative to it, but have never used it. That way you can define your structure very clearly, and perform migrations on it.
Additionally, this has the advantage that it provides more control in that you can define things not possible in Wt (like indexes for example).