dbForge evaluation questions

Discussion of open issues, suggestions and bugs regarding database management and administration tools for MySQL
Post Reply
FyL
Posts: 2
Joined: Thu 10 Mar 2016 15:49

dbForge evaluation questions

Post by FyL » Thu 10 Mar 2016 15:59

Hello all,
I'm evaluating dbForge studio and had a few questions about the DB project.

I like this work model, text files for all entities, lets us keep them under source control, and generate diffs for deployment. I also appreciate being able to use command line utilities to generate the change scripts.

A couple of questions have come up:

Question 1: is it possible to generate DML as part of a database project sync/comparison operation?
I.e. - Say I have a table "ColorData" that is largely just there for foreign key constraint.. with rows like this:
1 Red
2 Blue
3 Green

and as part of new feature development, I need to add a new row:
4 Yellow

Is there a mechanism to
A) maintain these rows as part of the DB Project and
B) Synchronize the changes so that only the 4th row is sent to the DB?
Would I need to specify a 'do synchronize' flag for each table we wanted to treat this way?

Question 2:
Is it possible to specify a version-specific change command that only runs for a specific version/migration?
i.e. - We have a table with 2 columns:
ColA ColB

as part of our next version of the project, we want to create ColC that is equal to ColA / ColB when ColB is not equal to 0.

Writing the logic is not the problem, but rather, how would we handle this in the context of the project/the synchronization of it - and perhaps prevent it from running on the next next version?


Thanks!

alexa

Re: dbForge evaluation questions

Post by alexa » Fri 11 Mar 2016 11:26

Question 1: is it possible to generate DML as part of a database project sync/comparison operation?
Unfortunately, the Data Compare feature doesn't work with database projects.
Question 2:
Is it possible to specify a version-specific change command that only runs for a specific version/migration?
Could you please describe this in more detail?

FyL
Posts: 2
Joined: Thu 10 Mar 2016 15:49

Re: dbForge evaluation questions

Post by FyL » Fri 11 Mar 2016 16:25

sure - What I'm getting at is a script that is part of a migration. Something is really only valid to run while upgrading between versions of a product.
Let's say in v1.0 I have a table (table1) that has two columns, "A" and "B".

We're preparing to release v1.1 - for this version, I need to create a new column, called "C".
For this release, I want to initialize column C with A + B. i.e. I want to run this statement after the table was altered:
update table1 SET C = A+B;

that's the first part of the question.

The second part (assuming the first is possible) -
we're preparing to release v1.2 - This release doesn't touch table1, and I don't want to re-run the update statement above. Is there a way to handle this case automatically?

Thanks!

alexa

Re: dbForge evaluation questions

Post by alexa » Mon 14 Mar 2016 15:47

Thank you for the reply.

If you have a database with the table1 (col_A, col_B), you can create a database project that will contain table1 (col_A, col_B ) based on that table. Then you can open the project, open the file of the table and add col_С.

Upon comparing the database with the project, you can exclude the table1 from the comparison in the *.scomp schema comparison document so all the objects of the database project, excepting table1, will get synchronized.

Please be aware that dbForge works with database projects only on the level of schemas. If you want to synchronize data, you have to work with the database directly not using database projects.

Post Reply