Menu

#1 Xml based schema migration

NDO_2.0
open
nobody
None
5
2008-02-05
2008-02-05
No

Database updates should be database independent. Thus one and the same application could be updated by different customers running the application against different database products.

Today NDO generates SQL scripts to update database schemas after changes of the class structure.

NDO should do the following instead:
- Generate a line of Xml code in the file ProjectName.ndodiff.xml for each change in the database structure.
- There should be command elements for creating/deleting/renaming tables/columns.
- Each command should contain the current SchemaVersion entry as entered in the NDO Configuration Dialog.
- A diff editor should be written to edit the commands. It should allow to replace a create/delete command pair with a rename command.
- The PersistenceManager should have a method UpdateDatabase, which works like CreateDatabase, but doesn't get a Sql script as parameter. Instead it gets a ndodiff.xml file. UpdataDatabase looks at the current schema version as shown in the NDOMapping.xml und executes the commands which have higher SchemaVersion entries in the .ndodiff.xml file.
- The commands will be replaced with Sql statements by the UpdateDatabase method. Thus the updates are database independent. One and the same application can be updated by different customers running the application against different database products.

Discussion


Log in to post a comment.