How to update the data model from an existing database

Hi,

I already generated a model for existing database and also the UI screen but now I want to update my data model again in cuba from existing ms sql server database, i use the approach database first, i updated my database/tables using ms management studio, i want to update my data model in cuba now, how can I update my cuba data model from my database after the changes?

Thanks.

Hello, could anyone answer my question, it is vital for the development / migration of my application to a new platform.

Thank you.

Hi,

so normally the generate java entities (and according screens) that come out of this DB-model generator should be treated as the starting point for the actual development. This might happen because of a migration of an old application and alike.

So its main point is to generate the boilerplate code out of the DB (which is problematic, because the database does not have all the required information to generate a proper domain model from like validations etc.) more as a one-off thing.

But doing your data model changes in the DB exclusively will lead to certain problems. I assume that Studio is not capable of e.g. doing deltas for the UI screens after you changed attributes in the DB. This is only really possible if the changes are made through Studio and more precisely through the JPA entity layer.

What is the reason why you want to do your changes exclusively in the DB? I think this is not very common, actually…

Bye
Mario

Hi Mario,

The database changes as needed, adding required fields to an existing table is an example:

  • create the “Active” field in the table that accepts NULL value
  • give an update in this field with some default value “1”
  • change this field to NOT NULL

The above example is a very frequent thing in my development.
This way I have complete control of how my database should be without losing any information already registered in it.

I have a great application made using the Microsoft Lightswitch Silverlight Client (over 200 tables), and I am studying alternatives to migrating my application.

And what prevents you in this example to do this change through the JPA entity layer and generate the associated SQL scripts through studio?

These steps that you describe are exactly what studio will generate in this case.

I think it is a lack of knowledge of how to use the cuba studio, it would be interesting if you let the cuba studio test in all its glory for 30 days without restrictions on the number of entities we can generate, or another type of licensing, as a community version without the addons and without restrictions or a model where I can buy cuba studio and have the right of updates for a year, after this period I lose the access to new versions but would maintain my cuba studio version unrestricted operation, in this way if I want to have access to new versions I renew my licensing, I say this because I use the components of DevExpress and its licensing model is this way and it is very good.

Thank You.

Hi,

I have the same question. Is there a way to update the model in cuba?
I use a erd modeling software to work on my database design. So I design my model and update the database with the modeling software. And then it would be nice if I wouldn’t have to add the changes manually.

Thanks