#1 2016-02-12 03:31:16

rafikrafael
Member
Registered: 2015-09-26
Posts: 1

Mormot can change table structure after create?

If I change a property of a inherited tsqlrecord class, mormot orm will make the change in database structure?
Example
Original
   property Name index 100 read FName write FName;
Change the size
   property Name index 150 read FName write FName;

If not, I will have to manual change de table?

Thanks

Offline

#2 2016-02-12 07:48:37

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,206
Website

Re: Mormot can change table structure after create?

Such changes are to be made manually.
The ORM only track NEW properties, not changing existing property size or type.
CreateMissingTables() only create the missing tables, and missing fields...
See http://synopse.info/files/html/api-1.18 … QLADDFIELD

The main reason is that changing the database structure is very tricky, and in some cases, not even feasible.
Not to mention that schema migration could be very painful for a huge existing database, in terms of migration time...

About text field size, you should better either set a huge size, or use a database which handle unlimited TEXT columns with no performance penalty, as SQLite3, PostgreSQL or MongoDB.

Online

Board footer

Powered by FluxBB