Only 3/4 tables were created under Navigator/Schemas in MySQL Workbench - mysql-workbench

I have created 4 tables total but can only see 3 of them under navigator/schemas in the area where you can write code. Why is that? The 3 tables I can see are all referencing the table that I can't see and all have foreign keys that reference the same column in the table I can't see under navigator/schemas.

refresh all under the database, that brings all to the left window, what you have done.
This you have to manually, because it is nit automatically refreshed, so a `Refresh all** exists at every node in the tree view

Related

Make column editiable in pgadmin4

How to unlock the fields in pgadmin4 so I can insert/update column directly threw pgadmin4 Data Output result.
Please refer below image displaying lock icon in each field
I want result like below which has icon of a pencil which shows that the field is editable.
I have given all the permission on the table.
Give your table a primary key column. Otherwise, pgAdmin4 has no way to communicate to the database which row you are trying to edit.
We have to make sure we have selected the primary key at tables properties level (right click on your table).
You can do that inside table properties column section:
It happens if I do a join with me, try seperately running the queries without joins for the columns that you want to edit.

How do you change a table's schema?

We have a MySQL Workbench project with two tabs (two schemas/two databases).
If we create a table in the first tab, it's attached to the schema
magikweb_dev_igcweb.
If we create a table in the second tab, it's attached to the schema
magikweb_dev_igcweb_archive.
If we copy-paste/duplicate a table from the first tab to the second tab, the resulting table remains in the first schema. How can you change a table's schema?
Each schema is linked with a specific database, so when we use the "Synchronize Model..." feature, it links all the tables properly.
Use the model tab. You can cut out a table from one schema tab and insert it into another.
The cut-and-paste method described in another answer works well for tables with no foreign keys, and for a reasonable number of tables.
An alternative that preserves foreign keys is to export the model as a SQL script, edit it, and then import the new script into a new model.
Using MySQL Workbench v6.3:
File -> Export -> Forward Engineer SQL Script
Carefully edit SQL script. Replace references to one schema with the other, for the tables you want to move. Do this both for CREATE TABLE commands and foreign key references.
File -> New Model
File -> Import -> Reverse Engineer SQL Script
Unfortunately you will then need to recreate any diagrams. But that can be straightforward if you have the original diagram as reference (take a screenshot or export it to PNG or PDF.)
Follow this simple steps (never miss step 4 and 5) :
Open Model Tab
Choose source schema. In my case, I want to copy table users from schema abc_develop_v1 to schema abc_develop_v2 then paste to diagram . So I choose schema abc_develop_v1, right-click table users then Copy 'users'
Go to the targeted schema. In my case is schema abc_develop_v2, right-click then Paste 'users'
Next, copy table users from schema abc_develop_v2. Right-click table users then Copy 'users'
Go to your diagram and Paste 'users'.
That's all. Your table is ready in your diagram with the right schema :-)
Notes: You can double check by double-click on the table in your diagram, and look at the right corner. It will show the Schema name.
I found a less painful way to do this.
Save and backup your diagram and your schema.
Display schema's name before table's names in diagram. This will make the next step easier.
Right-click on the tables which are on the wrong schema, and select "Copy SQL to clipboard". Paste the script in a new SQL window. Repeat for each table you want to migrate.
Edit the script to change the schema name. Watch for any miss in entries, the wrong schema might be a reference at any line. Mine was mydb, which I don't remember creating. Execute the script. Now you have the tables on the right schema.
Synchronize your model. Be sure to check "Update the model" for each missing table, otherwise, the tables will be deleted from the schema :)
Drag'n'drop the newly created tables into the diagram. Then remove the ones which are using the wrong schema. Tip: tables that are not in diagram won't display a dot next to their name.
Optionally, you can delete the faulty schema from the model so this never happens again. Be sure to know what you're doing first!

Database table columns missing in MySqlWorkBench, working with v6.3 so not an upgrade issue

I know that another question of same title exists, but I am new and unable to leave a comment there.
After 6 months of using MySQLWorkBench v6.3, all of a sudden I can no longer edit my table columns.
When I click on the tool icon next to the table name in the scheme, all of the fields I would need to edit for columns are disabled and empty.
I can see my indexes.
I can see my foreign keys.
I can see all the columns listed in the tree under the schema.
But I can't see any columns in the Columns tab for that table.
This just started happening this week. I've tried rebooting, refreshing, and giving my PC some rest and relaxation.
Any other ideas?
The last thing I did in my database was add a foreign key, which was successful. After that, starting having column issue. Not sure if that's a clue or not.

Some fields are missing in the fieldexplorer. How to show all fields?

i'm using Crystal Reports with my ERP-System. There have been predefined reports i now want to change.
In the field-explorer are some tables which have been renamed for better readability. But those tables are missing some fields, i want to use. If i connect the whole table again, all fields are there. Is there a way to display all fields in the predefined tables.
I tried to refresh the Database but nothing changes. If i delete the predefined table and then rename the new one to the old one, so i can use all predefinded formulas, all used fields in the report get deleted. I would need to recreate the whole report then.
Thanks for the help
If it is truly the same table and is not showing all the fields then you need to do "Database > Verify Database". That will force CR to refresh the structure of the table (instead of just the data). If this doesn't add the missing fields then the table in the report is actually a different object.
To see what the table/view the report is actually using go to "Database > Set DataSource Location" and look at the properties node for that table. It will show if it is a table/view/SP and what the true object name is.
If you want to replace the existing table with a different table you go to "Database > Set DataSource Location" again. Highlight the existing table in the top window, connect and highlight the replacement table in the bottom window. Then click update. Crystal will replace one table with the other and all of the fields in the report that exist in the new table will be mapped automatically. Note that the new table will keep the alias of the original table. If you are unsure if the table was updated you can look at the properties node in the top window to see the change.

How do I delete a table from the MySQL Workbench catalog?

Recently I started using MySQL Workbench to design my data structures with an UML diagram. However, there is one thing I could figure out.
It seems that if I delete a table from the EER-diagram view, the table persists in the catalog view (as illustrated by the screenshot below). I could find a way to delete from the catalog view and it still list in the foreign key table reference selection screen.
This is very confusing. How can I effectively remove the table (not only from the view but from the whole project?
Notice, the two question tables one of which I deleted in the view and redesigned.
In case if the right-click and delete didn't work,
Simply drag and drop the table from the Catalog Tree to the Design area. Then you will see the table gets inserted there. From there, right-click on the table and select delete table. Then the table will get deleted from the whole project (assuming correspondent objects which are needed deleting as well).
Just had this problem before.
CMD + Backspace / delete on the keyboard will only delete the figure in the designer.
To completely delete the table and figure, instead try: Right-click > Delete 'table'.
I am using "MySQL Workbench Community (GPL) for Mac OS X version 6.2.3 revision 12313 build 2282 (32 bit)" and the action "delete 'table'" in the context menu (right-click on the table) did not work for me.
Believe it or not I had to restart the whole application. After the restart the delete action worked as expected. (1 object(s) deleted) [nothing about the object is kept in the DB]
This is how I discovered the difference between "delete" and "remove figure".
The "delete" deletes tables from the whole project, the "remove figure" only from the diagram (the tables still stay in the catalog).