MultiModel Design

I'm using multi model design in combination with inheritance.

[Entity]
[Model('TenantDb'), Model('Dummy')]
[Inheritance(TInheritanceStrategy.SingleTable)]
[DiscriminatorColumn(csFldKind, TDiscriminatorType.dtString)]
TEntity = class
...
end;

[Entity]
[Model('TenantDb')]
[DiscriminatorValue('Child']
TEntityChild = class(TEntity)
private
  // some fields
  FAnotherEntityInDummy: Proxy<TAnotherDummyEntity>;
...
end;

Starting Server-App is executing
TDatabaseManager.Update() using Dummy-MapExplorer.
because these Entities are required building TenantDb MapExplorer.
These Entities are containing configs for dynamic properties.

TDatabaseManager.Update() is called using AllowDestructive false.

But because of missing TEntityChild in Dummy-Model my foreign key defined for FAnotherEntityInDummy will be removed every time.
All fields are not removed because of AllowDestructive is false.

How could I fix my model?
I could not add TEntityChild to Dummy because there are a lot of Associations and Many-Valued Associations that are not required for Dummy-Model.

AllowDestructive commands just prevent commands that would destroy data. Removing a foreign key is not the case.

There is not much you can do besides getting the SQL Statements generated by Aurelius and executing them one by one, skipping the foreign key command.

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.