You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@empire-db.apache.org by le...@Safe-mail.net on 2010/05/14 15:59:37 UTC

use of ddlutils for database schema synchronization

Hello

empire-db has supplementary ddl sql creation. Generated sql may be then used to create the whole database or table from scratch.
However most often changes in database schema are incremental, in example new columns are added to existing tables or columns
are indexed for better search performance. empire-db does not support such situations.

There is project called DdlUtils (also from apache foundation) which may do a lot broader set of database changes, not only
creation from scratch but also alteration of an existing database schema to a new schema - ie:
- adding/removing table/column
- change of column type precision, change of column type
- adding/removing index
- adding/removing foreign key
It does not handle table or column rename but it is difficult to do it automatically anyway. If necessary data from
existing tables are copied to helper tables to avoid data loss.

I have written a function which "translates" empire-db DBDatabase to ddlutils Database (with tables, indexes and foreign keys).
Then the resulting database model may be used directly by ddlutils to create or alter table schema, write sql etc.
If somebody are interested I can contribute this "experimental" code.

Regards
Leszek Piotrowicz

Re: use of ddlutils for database schema synchronization

Posted by Francis De Brabandere <fr...@gmail.com>.
Hi Leszek,

First of all welcome to the empire-db community.

> I have written a function which "translates" empire-db DBDatabase to ddlutils Database (with tables, indexes and foreign keys).
> Then the resulting database model may be used directly by ddlutils to create or alter table schema, write sql etc.
> If somebody are interested I can contribute this "experimental" code.
>

Sounds like a great idea. Can you create a jira issue with your code
attached? Then we can have a look at it.

Cheers,
Francis


-- 
http://www.somatik.be
Microsoft gives you windows, Linux gives you the whole house.