Not able to view grid lines in MySQL Workbench - mysql-workbench

I'm trying to create a schema, but in Workbench when I add a diagram it shows nothing. I've tried adding tables and nothing shows up. I'm not sure what I'm missing here. Does anyone know why this is occurring?

Diagraming is part of modeling, so it will not affect your live database. Either use modeling then forward-engineer the model/diagram, or simply edit the database/schema with Workbench (and don't use modeling). The latter is simpler and more straight-forward.
Consider the FAQ entry titled How do I create a MySQL database (schema) in MySQL Workbench?
Or if you're goal here is to use modeling, then consider the tutorial titled Creating a Model; and it also shows the forward-engineering procedure.

Related

Is there any way to create diagram for localdb?

I have created a database using Entity Framework code first approach, and now I am trying to verify the relations of data tables but unfortunately after wasting 2 days still unable to get any solution.
According to this article the following query solves the problem.
alter authorization on database::[your-db-name-no-quotes] to sa
I tried it and it worked for me.
You might try to use Entity Framework Power Tools that is a Visual Studio add-in that was used to create the data model diagrams shown in these tutorials. The tools can also do other function such as generate entity classes based on the tables in an existing database so that you can use the database with Code First. After you install the tools, some additional options appear in context menus. For example, when you right-click your context class in Solution Explorer, you get an option to generate a diagram. When you're using Code First you can't change the data model in the diagram, but you can move things around to make it easier to understand.
There is a possibility to create a diagram from an existing database. You could use SQL Server Management Studio Express diagram generator. Right-click in diagrams folder in the database and choose create a new diagram.
Please also refer to this answer: Generate table relationship diagram from existing schema (SQL Server)

How can I add tables to a model?

I added new table to my database and I managed to add it to my data model, using "Update model from database" option. But I cant generate class to acces this table in code. "Add code generation item" results into creating classes for all tables i have in my database.
Well, it seems to be a duplicate, but don't delete this topic at once please, for I've been searching for solution quite a long time and found nothing helpful.
You don't need to add code generation item again if you already did it once. Normally it should be enough to save your EDMX file and generation should trigger. If it for any reason doesn't work, right click on .tt file responsible for generating your classes in the Solution Explorer and select Run Custom Tool from the context menu.

Some questions before choosing/start learning Yii framework

I've been developing simple PHP/MySQL web sites for some years.
Never used a PHP Framework before and I understand I'll need to know OOP, no problem.
I'm about to start a SaaS project of my own.
A)
So far, I've seen Yii generates the CRUD and pages according to the DB.
Is it easy to modify the generated code?, like, adding a new DB field and its form field without not generating again all the stuff every time I change something in the DB and losing other customizations?
I mean, I'm 100% sure the generated DB code and pages are not going to be enough and I'll be constantly adding and correcting fields, and adding more tables etc.
B )
My project will include a Shopping Cart and Calendar(for events, tasks, etc.).
Does Yii has these options or at least an easy way to implement it like the Authentication options or Database listing, etc.?
C) Does documentation has this explained as a tutorial/book or is more like a reference(minimum explanation that only advanced user understand how to integrate it)?
thank you very much
Yiiframework has excelent documentation (you can start from here). Also there is an extensions area in the downloads section where you can find all available yii extensions.
All your questions can be answered if you follow their easy tutorial.
A) Yes, it's easy. You will just add code for new fields not changing it all.
B and C are answered by Stratosgear very well.
Is it easy to modify the generated code?
Yes it is. If you later decide to add more fields to the table, you can do that from your Phpmyadmin using sql commands.
You also need to edit the generated class file adding those new fields to correspond with that on your table.

Is there an easy way to create a database diagram in SQL Server

I'm not sure if I have worded this question properly I will explain what I am trying to acheieve further.
I am looking to create a graphical representation of an existing database showing table relationships Key relationships etc.
I have seen posts around the internet that suggest you can just go; New > Database Diagram. But I have seen nothing to this effect in Management Studio
Something similar to this:
You first need to install the Diagram Support objects. Then you all you expand the database out and right click the Database Diagram folder
If there is an database diagram drawn for the database it should be visible if you collapse DataBase Diagrams under your database. If you are trying to create one that is the way to go about it create new database diagram.

Update model from database - refresh one table

Is it possible to refresh only one entity in entity framework designer? Every time I refresh model from database, it refreshes all entities. The problem is that this mechanism doesn't recognize properly primary keys in views, so I have to correct it manually. Am I missing something?
No, you're not missing anything. When you update model using the GUI designer, the entire storage schema is regenerated. At least, that's how it works in Entity Framework 1.
I can't tell you if you can or can't do it, but I have one clue how to figure it out.
http://code.msdn.microsoft.com/EdmGen2
EdmGen2 contains source code and dll probably with functionalities from usual EdmGen.
Unfortunately I didn't have time to investigate this further. Hope this helps.