Hi Maxim,

there are even other situations, like adding columns that are not null to tables with existing data, etc etc. This is why most RIFE developers that I know of write a customer development-time participant that uses the CrudContentQueryManager to create the db structure and populate with some data. You can then also for example throw away all the existing tables. An example of using that content query manager can be found here: https://svn.rifers.org/ecalendar/trunk/src/java/com/uwyn/ecalendar/ participants/CreateArticletypeStructure.java

By doing this, you essentially constantly create a up-to-date database structure for development each time your app starts up.

I don't think that a partial solution for only adding table columns that can be null and that have no foreign key constraints is a very good idea. A lot of constraints information will not be propagated and will create potential problems for deployment-time. Like different precision, max-length for columns, other unicity constraints, etc etc. By re-creating with a well known data set every time your application starts up in development, you're certain that you're always developing against the latest database structure.

This habit also has a lot of additional benefits, like very easy migration to other databases, easy installation for new developers on the team, easy setup of a demonstration instance, etc etc.

However, if you do feel that adding column automatically is that important, feel free to contribute it to rife-contrib. If you want I can provide you with an SVN login/password for the repository. You'll have a bit of work to add to RIFE/core also since there's no query builder for AlterTable yet. I will probably be adding that in a couple of weeks/months, however if you want to leverage that sooner you can look at the existing query manager to see how they're built. It shouldn't be very difficult to write this new one.

Best regards,

Geert-

On 26 Dec 2006, at 10:50, Maxim Grigoriev wrote:


Hi Geert

I think that 70% of all changes during development are new columns, new
tables.
Especially it's hard to make with new CMF columns.
And if this problem will be solved, only 30% of problems will remain.
Hibernate makes columns adding, not removing or type changing. I've never spent much time for these 2 operations. But now i'm spending much time to
understand where should i add my column.
You're right about other problems but they're complex and almost
non-automized.

Maybe it can be easy to implement some ui for crud objects where user can
easy manage columns ?


Geert Bevin wrote:

Hi Maxim,

I agree that this would be a useful feature. The reason why this
hasn't been implemented yet is that this is only a small part of a
very difficult topic that is schema migration. Once you start going
down this road, people will expect more of it. For example, changing
the data types of your properties, deleting properties, normalizing
or splitting tables, etc etc. This almost becomes impossible to do
'automatically'. You say that Hibernate supports this, but I've never
really seen it working reliably. When I for example upgrade
Confluence, it's recommended by Atlassian to dump the entire DB and
recreate it from scratch instead of using the schema migration
functionality.

There are difficult questions that come into play with regards to
what happens with existing data, how to handle complex relations that
rely on other modifications, etc etc. If you couple these with the
fact that many databases don't expose a lot of information through
JDBC meta data, it can become very tricky next to impossible to do
right.

I personally prefer thinking more along the lines of a schema
migration framework, like what Rails provides. We kind of discussed
this on the list a while ago, but nobody ever got enough time to
implement it until now:
http://www.nabble.com/CRUD-and-Table-Creation-tf1652964.html#a4606148

Best regards,

Geert


On 25 Dec 2006, at 17:21, Maxim Grigoriev wrote:


I've just created this issue
http://uwyn.com/issues/browse/RIFECRUD-4
I think it will be very usefull feature.
--
View this message in context: http://www.nabble.com/Make-
CreateCrudStructureParticipant-to-update-db-schema-
tf2879818.html#a8047477
Sent from the RIFE - users mailing list archive at Nabble.com.

_______________________________________________
Rife-users mailing list
[email protected]
http://lists.uwyn.com/mailman/listinfo/rife-users


--
Geert Bevin
Uwyn "Use what you need" - http://uwyn.com
RIFE Java application framework - http://rifers.org
Music and words - http://gbevin.com


_______________________________________________
Rife-users mailing list
[email protected]
http://lists.uwyn.com/mailman/listinfo/rife-users



--
View this message in context: http://www.nabble.com/Make- CreateCrudStructureParticipant-to-update-db-schema- tf2879818.html#a8052055
Sent from the RIFE - users mailing list archive at Nabble.com.

_______________________________________________
Rife-users mailing list
[email protected]
http://lists.uwyn.com/mailman/listinfo/rife-users


--
Geert Bevin
Uwyn "Use what you need" - http://uwyn.com
RIFE Java application framework - http://rifers.org
Music and words - http://gbevin.com


_______________________________________________
Rife-users mailing list
[email protected]
http://lists.uwyn.com/mailman/listinfo/rife-users

Reply via email to