Maintaining db table using crud

View: New views
2 Messages — Rating Filter:   Alert me  

Maintaining db table using crud

by Roar Skullestad :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


Hi,

After removing the following from a MetaData class:

        addConstraint(new ConstrainedProperty("myColumn")
                .notNull(true).notEmpty(true).listed(true));

I get the following exception (as expected) when trying to insert using
crud:
        java.sql.SQLIntegrityConstraintViolationException: Column 'MYCOLUMN'
cannot accept a NULL value.

Is there a way to automatically update the database scheme (in this case
derby) after changes in a beans meta data (including added and removed
constraints)? If not, is there a best practice to handle database scheme
changes using Rife and/or Crud?

Thanks for a great framework!

Best regards,
Roar Skullestad

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "rife-users" group.
To post to this group, send email to rife-users@...
To unsubscribe from this group, send email to rife-users-unsubscribe@...
For more options, visit this group at http://groups.google.com/group/rife-users?hl=en
-~----------~----~----~----~------~----~------~--~---


Re: Maintaining db table using crud

by Coat :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


Hello,

This would be a cool feature, like database migrations in Rails.

I don't believe this feature exists, I usually make the necessary
changes myself on the production database when rolling out changes.
During development using derby or hsqldb, I usually just trash the dbs
directory (if using a jumpstart project) and restart rerun the
project.  I have a participant that installs the database structure
and populates test data.  Not sure if this is best practives or not, I
am curious as to how other people handle schema changes.

Kent

On Dec 2, 2:07 am, "Roar Skullestad" <r...@...> wrote:

> Hi,
>
> After removing the following from a MetaData class:
>
>         addConstraint(new ConstrainedProperty("myColumn")
>                 .notNull(true).notEmpty(true).listed(true));
>
> I get the following exception (as expected) when trying to insert using
> crud:
>         java.sql.SQLIntegrityConstraintViolationException: Column 'MYCOLUMN'
> cannot accept a NULL value.
>
> Is there a way to automatically update the database scheme (in this case
> derby) after changes in a beans meta data (including added and removed
> constraints)? If not, is there a best practice to handle database scheme
> changes using Rife and/or Crud?
>
> Thanks for a great framework!
>
> Best regards,
> Roar Skullestad
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "rife-users" group.
To post to this group, send email to rife-users@...
To unsubscribe from this group, send email to rife-users-unsubscribe@...
For more options, visit this group at http://groups.google.com/group/rife-users?hl=en
-~----------~----~----~----~------~----~------~--~---

 
 
 
Google
rifers.org web