Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What Inserts tab does in MySQL Workbench EER Diagram Table Editing?

I needed to insert some initial (default) data into a new database and I found this Inserts tab on MySQL Workbench EER Diagram table editing form

Table Editing - Inserts

My assumption was that I can use it to insert initial (default) data that will get propagated to the database during synchronization (not sure how it will get merged with any existing data in the database though...). I added couple rows and synced model with an empty database, but no data was inserted.

So, my question is what this Inserts tab is for on the Table Editing screen?

I use MySQL Workbench 6.

P.S. If somebody can also point to an easy way to insert initial (default) data (except simply running a SQL script) I will appreciate it.

Thank you.

like image 379
Nikolai Samteladze Avatar asked Jan 29 '14 21:01

Nikolai Samteladze


People also ask

How update EER diagram MySQL Workbench?

From the MySQL Workbench 5.2 window, select Database -> Synchronize model which will allow you to synchronize the model (EER diagram) with the database (you need to create a saved connection) for it.

How do I insert data into a MySQL Workbench table?

Double-click the first entry in one of your columns and type the data to be added. After entering the necessary data, hit Enter on your keyboard. Double-click under that newly created row and create another. Once you add all of your data, click Apply to execute the SQL Script.

How do I edit a table in MySQL Workbench?

You can add or modify the columns or indexes of a table, change the engine, add foreign keys, or alter the table name. To access the MySQL Table Editor, right-click a table name in the Navigator area of the sidebar with the Schemas secondary tab selected and click Alter Table.

What is EER diagram in MySQL Workbench?

Enhanced Entity-Relationship (EER) diagrams are an essential part of the modeling interface in MySQL Workbench. EER diagrams provide a visual representation of the relationships among the tables in your model. Revisions made with the Model Editor are shown in the associated diagram.


1 Answers

The data added on the INSERTs page is indeed thought to be like an initial set of (test)data. It doesn't consider existing data however. I think it is also only used if you do forward engineering, not on synchronization.

Other ways of inserting data always involve an SQL script, that's what the (text) API is about for SQL servers. But you can add scripts to your model too (see the overview page). They are not run automatically, however.

like image 111
Mike Lischke Avatar answered Oct 07 '22 19:10

Mike Lischke