When exporte to Aurelius, there some new tables(create table), and there are some updated tables(alter table) in the database sheama. If i use BuildDatabase exception is raised ('...Table already exist.'). If i use UpdateDataBase the new tables are not created. How can i create tables and update tables?
BuildDatabase indeed will create all tables so if any table exists, an error will be raised.
I Wagner, if you try export a database schema with DataModeler, and updatedatabase with aurelius, does't work, try please...
Can you provide your data modeler project with current aurelius export settings so we can test it here?
I solve my problem, registing every Table (Class) like this:
class procedure TDBSchemaRegister.RegisterEntityClasses;
var Setup: TMappingSetup;
Setup := TMappingSetup.Create;
It's not the best way, i know, every time add a new table and export to aurelius, i have to add code :(
This is because you didn't use the classes in your application, thus the linker removes the classes from it. If you have a real application, the classes will be used from code, and you wouldn't need to register them.
sorry, i don't understand, how can i do that? as i said before "... If i use UpdateDataBase the new tables are not created...."
Suppose you have a class TCustomer declared in a unit exported by Data Modeler. If you don't use that class anywhere in your application, Delphi linker will remove it from the application. There is no way Aurelius could create a table related to the class, because the class simply doesn't exist in the .exe. You have to either remove optimization, or use the class in your application. A simple code like this will solve:
Ok, make sense. For me is solved.
But would be nice data modeler register the class ;).