I am migrating an existing database by creating all new tables as entities so for example the existing database has 325 tables and I am adding 2 new ones. when I run DBManager.ValidateDatabase I get the following Schema Messages even when I use the MappingSetup to register only the two new tables.
I have lost tables in the past but currently the above Removed action does not work because of other errors.
Is there a way if getting Aurelius to ignore any existing tables that is not registered in Aurelius?
Eventually I will add the existing tables to the persistent entity classes but not all of them. The legacy code will still need to access the database outside of Aurelius.
Hi Greg, I'm confused about the whole scenario, I didn't understand it well.
Both TObjectManager and TDatabaseManager uses the TMappingexplorer object passed to it to know which classes (and thus tables) it should consider. Does this info help? If not please try to explain with code examples so it gets clearer for me what you are trying to do.
In the example above the MS Sql Server database, say MSSQLdb,1 already has tables 001 to 325 in it from another system and they are managed using DBExpress. I have added tables 326 and 327 using the following code.
function TMSSQLScenarioFactory.GetMapping: TMappingExplorer;
var
MapSetup: TMappingSetup;
begin
MapSetup := TMappingSetup.Create;
try
MapSetup.MappedClasses.RegisterClass(TGLOutput); \=Table326 in example
MapSetup.MappedClasses.RegisterClass(TOutputMapping); \=Table327 in example
it's simple, you say in Aurelius your database should have two tables. It's checking your database and performing a validation saying that the database you have needs to have 325 tables remove and 2 tables to be the way you want.
Either you add the 325 tables to Aurelius database manager or you have to live with it, I don't know how do you expect that Aurelius will tell if the table is a legacy table that must be kept, or is a leftover table that must be removed?