You are not logged in.
Pages: 1
How do I modify model / database? For example, how do I add a new field to a table?
Offline
Just add a published property to the class definition.
The column will be added to the table when the application starts.
It will call the corresponding TSQLRecord.InitializeTable method, with the field name, so that you could be able to initialize the table by itself according to this newly added field.
To delete or rename a column is not handled yet. Because we would need history, like in Ruby on Rails. I didn't find it very useful yet.
And... SQLite3 doesn't allow you to call ALTER TABLE in order to delete a column.
See http://www.sqlite.org/lang_altertable.html
But you can rename it.
It's better relying on the database version number, and write your own renaming code after calling TSQLRestServerDB.CreateMissingTables.
In all cases, see this method of SQLite3.pas to see how the database layout is synchronized.
Offline
Pages: 1