DataModelling or ER model building software for MacBook and MYSQL - mysql

Hi Friends I have been looking for to build a ER Diagram for my database in Macbook.
Please help me finding a right tool for the same.
I have tried MYSQL Work bench but i need it to be updated dynamically if the DB gets changed.
Also have tried some online stuffs like gliffy.com but of no use.
Please help me I am new to Databases so quick help will be appreciated.

You won't get automatic updates (I understand automatic updates as something that happens in the background without any action from you).
MySQL Workbench however has a two-way sync that you can use to update your models at the same time you update your schema (from the model). You can select to do only one direction, but you have to trigger synchronization yourself.

SchemaCrawler is a free tool that generates diagrams from a database. It is driven from the commandline. You can generate a new diagram quickly, when your database changes, by re-running your command. Here is an example diagram:
Sualeh Fatehi, SchemaCrawler

Related

MySQL Workbench equivalent for SQL Server

I'm new at SQL Server and I've been looking for an official database modeling tool (if there is one in existence) so that I can design EER Diagram and export it as an actual database.
So far I have only found tutorials on creating a table for a model, similar to this one: http://www.asp.net/mvc/overview/getting-started/introduction/creating-a-connection-string; but since my EER contains relationships between models, I need to design the diagram.
Thanks in advance.
forget this my last information. ER Master is nice, but it isnt the answer you want.
Yes, you can do it with MS SQL Server Mangament Studio. Under the root node of datebase exists one entry "Database diagramm". If you will open this. You can choose, which Tabels you want to see in E/R Diagramm view.
Try this,
http://ermaster.sourceforge.net/
its a nice plugin for eclipse.

Model design in Django. Is South the only way to have any bit of freedom in changes in model?

Hi I am newbie to django development, but anyway I will try in this question do not to be generall.
I have strange problems while designing my model. I want to make a lot of changes - like alwyas in the begining of the project. The problem is that after one syncdb I can not change anything in model, unless I create completly new database and link it in settings.py. What is pretty strange I even can not delete this old database. When I try do it from Sequel Pro it freezes.
I googled a bit, and is really South or similar tool the only option to have some fredoom in models desgining phase in django?
I know that this mechanisms are for certain purpose like keeping data consistency on existing project, but I just started my development and have even 0 records in all the tables.
I user in my development 5.6.13 MySQL Community Server, Django 1.5. All runing on OS X.
South is a great tool for migration or if you have made some changes. It may take a little time to get through for the beginners as it was for me too, but eventually you will like it. Other than that as per your question, you can use flush, which replaced reset in django 1.5. And please remember, that it flush all the database and not just the app.
python manage.py flush
But luckily reset has been ported back in here. All you have to do is install, and add it in the settings. And then run
python manage.py reset appname
Hope this helped!
OK. Partially I found answer here: Django: Change models without clearing all data?
SAYING: "syncdb will only create tables for models which have not yet been installed. It will never issue ALTER TABLE statements to match changes made to a model class after installation. Changes to model classes and database schemas often involve some form of ambiguity and, in those cases, Django would have to guess at the correct changes to make. There is a risk that critical data would be lost in the process. If you have made changes to a model and wish to alter the database tables to match, use the sql command to display the new SQL structure and compare that to your existing table schema to work out the changes."
OK. I see that I can run python manage.py sql <app_name> then should I paste it in python manage.py dbshell?
via dbshell I managed to delete whole database, what was not possible in Sequel Pro.
python manage.py dbshell
and then via MySQL:
drop database <db_name>;
And why the database when accesing from Sequel Pro is froozen?
I was trying to avoid South, because there were many opinions that it is confusing, and time consuming to learn. After sometime I look back on SOUTH and I have to say:
It is completely WORTH learning it, what is not hard at all.
It is very nice tool for dealing with model, which changes dynamically.
I can propose a nice tutorial video to all newbies, who will consider either it is or not worth to learn. http://www.youtube.com/watch?v=7yCmAhthkMk

How to execute SQL queries inside MySQL workbench

I am developing an application using Django framework. As you may know the workflow is you first describe your objects in Python classes and then you synchronize the database.
I made a MySQL Workbench EER diagram. Since then I continued to develop the application, so the database model is not updated in the EER diagram nor the MySQL Workbench model.
I tried to synchronize it using the built-in feature "Synchronize with Any Source" of MySQL Workbench, but this feature is not working for some reason and causes a segmentation fault. The queries to be executed inside the MySQL Workbench model are displayed but at the last step I get an empty SQL alter script. I tried manually copying the queries in that script and clicking the "Execute" button, but I had no luck with that. I think MySQL stores queries internally. Anyway. I submitted the bug to MySQL Workbench developers here and now it is fixed, but not yet released. I am now looking for a workaround while waiting for the next release.
Although I have a specific problem, the question remains generic.
Is it possible to execute queries on the MySQL Workbench model in order to alter it?
Did you try the "Forward Engineer" option? It allows you to reflect all the changes that were made to your table relations directly to the database which is a pretty useful functionality.
There are some catches though like the inability to maintain existing data every time forward engineering is performed however this can be compensated by entering some example data which will be shipped with the ER diagram the next time you perform "Forward engineer".

Easy ERD Program for MySQL

I need an ERD Program for design my database in MySql.
I tried :
DBDesigner
MySql Workbench
The program should be able to export a sql script
In Oracle i just JDeveloper. It was very easy.
What programs do you prefer?
I personally use MySQL Workbench, or I draw it out by hand. After that it's generally super simple for me to create a database in a matter of minutes (depending on the size).
That said, a simple google search brought me to this page, so the program attached to that website might be worth checking out.

How to synchronize development and production database

Do you know any applications to synchronize two databases - during development sometimes it's required to add one or two table rows or new table or column.
Usually I write every sql statement in some file and during uploading path I evecute those lines on my production database (earlier backing it up).
I work with mySQL and postreSQL databases.
What is your practise and what applications helps you in that.
You asked for a tool or application answer, but what you really need is a a process answer. The underlying theme here is that you should be versioning your database DDL (and DML, when needed) and providing change scripts to be able to update any version of your database to a higher version.
This set of links provided by Jeff Atwood and written by K. Scott Allen explain in detail what this ought to look like - and they do it better than I can possibly write up here: http://www.codinghorror.com/blog/2008/02/get-your-database-under-version-control.html
For PostgreSQL you could use Another PostgreSQL Diff Tool . It can diff two SQL Dumps very fast (a few seconds on a db with about 300 tables, 50 views and 500 stored procedures). So you can find your changes easily and get a sql diff which you can execute.
From the APGDiff Page:
Another PostgreSQL Diff Tool is simple PostgreSQL diff tool that is useful for schema upgrades. The tool compares two schema dump files and creates output file that is (after some hand-made modifications) suitable for upgrade of old schema.
Have scripts (under source control of course) that you only ever add to the bottom off. That combined with regular restores from your production database to dev you should be golden. If you are strict about it, this works very well.
Otherwise I know lots of people use redgate stuff for SQLServer.
Another vote for RedGate SQL Compare
http://www.red-gate.com/products/SQL_Compare/index.htm
Wouldn't want to live without it!
Edit: Sorry, it seems this is only for SQL Server. Still - if any SQL Server users have the same question I'd definitely recommend this tool.
If you write your SQL statements for your development database (which are, I imagine, series of DDL instructions such as CREATE, ALTER and DROP), why don't you keep track of them by recording them in a table, with a "version" index? You will then be able to:
track your version changes
make a small routine allowing the "automatic" update of your production database by sending the recorded instructions to the database.
I really like the EMS tools.
There tools are available for all popular DB's and you have the same user experience for every type of DB.
One of the tools is the DB Comparer.
TOAD
saved many an ass several times in the past. Why do people run sql with no exit strategy?
the redgate one is good also.
Siebel (CRM, Sales, etc. management product) has a built-in tool to align the production database with the development one (dev2prod).
Otherwise, you've got to stick with manually executed scripts.
Navicat has a structure synchronisation wizard that handles this.
I solve this by using Hibernate. It can detect and autocreate missing tables, columns, etc.
You could add some automation to your current way of doing things by using dbDeploy or a similar script. This will allow you to keep track of your schema changes and to upgrade/rollback your schema as you see fit.
Here's a straight linux bash script I wrote for syncing Magento databases... but you can easily modify it for other uses :)
http://markshust.com/2011/09/08/syncing-magento-instance-production-development
DBV - "Database version control, made easy!" (PHP)