Search code examples
delphipersistencespring4d

How to update a database schema in Spring4D 1.2


I'm experimenting with Spring4D 1.2's simple ORM (Marshmallow). I could get it to work pretty well but I can't find out how to have it update an existing database with a new schema.

For instance, in the "GettingStarted" project, I added one property to the data model:

[Entity]
[Table('Products')]
TProduct = class
{...}
  [ColumnAttribute('PRODUCTINFO',50)]
  property Info: string read fInfo write  fInfo;

No matter what, I can't get the framework to update the schema if the database already exists.

What am I missing ? Must I do that manually outside the framework ?


Solution

  • Schema update is currently not supported nor planned from my side.

    Generating the necessary drops and recreate would be reasonably easy but that is only part of the story as you probably want to keep any existing data. From using SQL Server Data Tools I know how deep this rabbit hole can go.