Prestashop database Schema - mysql

is it possible to create a graphical representation of specific object in database Schema and all it relationships with all linked metadata, views, and stored procedures assocated with this object? Example: I want to define a logical relationships between “Data Sheet” tab on Prestashop product page and the rest elements in a database schema.

Yes (partially) - use the mysql workbench. It has reverse engineering db tools
see mysql dev wb link
This will generate diagram of the tables + relationships. Stored procedures, views, trigger etc are not going to be supported (too complex). You will just have to browse and reverse them yourself.

Yes, you can find PrestaShop's new Physical Data Model here: http://www.prestashop.com/blog/en/a-new-physical-data-model-available-for-prestashop/

There is a MySQL workbench model in the dev directory of the Prestashop distribution (although the last one I looked out was out of sync with the actual release database schema, although that could have been a development release). I would make that my first point of call. Unfortunately it won't show up every relationship between tables though.
One of the quickest ways to do analysis is to take a snapshot of the database, insert a particular record (user, order, customer, data sheet etc.), take another snapshot, then diff them.

Related

Which RDMS for Tableau connections?

We are finally moving from Excel and .csv files to databases. Currently, most of my Tableau files are connected to large .csv files (.twbx).
Is there any performance differences between PostgreSQL and MySQL in Tableau? Which would you choose if you were starting from scratch?
Right now, I am using pandas to join files together and creating a new .csv file based on the join.(Example, I take a 10mil row file and drop duplicates and create a primary key, then I join it with the same key on a 5mil row file, then I export the new 'Consolidated' file to .csv and connect Tableau to it. Sometimes the joins are complicated involving dates or times and several columns).
I assume I can create a view in a database and then connect to that view rather than creating a separate file, correct? Each of my files could instead be a separate table which should save space and allow me to query dates rather than reading the whole file into memory with pandas.
Some of the people using the RDMS would be completely new to databases in general (dashboards here are just Excel files, no normalization, formulas in the raw data sheet, etc.. it's a mess) so hopefully either choice has some good documentation to lesson the learning curve (inserting new data and selecting data mainly, not the actual database design).
Both will work fine with Tableau. In fact, Tableau's internal data engine is based on Postgres.
Between the two, I think Postgres is more suitable for a central data warehouse. MySQL doesn’t allow certain SQL methods such as Common Table Expressions and Window Functions.
Also, if you’re already using Pandas, Postgres has a built-in Python extension called PL/Python.
However, if you’re looking to store a small amount of data and get to it really fast without using advanced SQL, MySQL would be a fine choice but Postgres will give you a few more options moving forward.
As stated, either database will work and Tableau is basically agnostic to the type of database that you use. Check out https://www.tableau.com/products/techspecs for a full list of all native (inbuilt & optimized) connections that Tableau Server and Desktop offer. But, if your database isn't on that list you can always connect over ODBC.
Personally, I prefer postgres over mysql (I find it really easy to use psycopg2 to write to postgres from python), but mileage will vary.

MySQL Workbench 6 - difference in creating database / schema as a model and within a MySQL Connector

I was rooting MySQL Workbench and I had a TILT.
In MySQL Workbench initial screen there are two things I did not understand.
When creating a connection and access this, I have the option of creating schemas / databases and create your tables, scripts, etc. .. If I create a database named example, I only have the option to create the tables by script, not by EER diagram.
Returning to the MySQL Workbench initial screen, there is also the option of creating a model (for me it is a schema / database in the same way). If we create a model named example, as in the previous item within this you can create scripts, views, tables, and have the distinction of creating EER diagrams.
What I wanna know is:
Why there are options of create schemas / databases as models and within MySQL Connections?
why I can create schemas / databases with the same name in both options to create schemas / databases (MySQL Connectors and Models) without naming conflicts happen?
If they are the same thing, why when I create a model MySQL Connector does not synchronize automatically to recognize the model?
If they are the same thing, that I can create EER Diagram for schema / database in the Model and not in MySQL Connector?
Thanks to anyone who can answer me these questions.
You started from the wrong premise. Models and connections are two completely different things (why would there be different sections in MySQL Workbench if not?).
Via connections you can reach a server and work on it. Create users, retrieve data, create db objects etc.
Modeling is however the task to design a database structure. All the objects you create only exist within that model. You can design your structure from a higher level of view instead of going down to the pure SQL (which you can too, if you want). Nothing reaches a server until you either forward engineer your model or synchronize it to that server. The first is simply creating all the objects as you designed them, the latter is a two-way 'merge', that is, a diff is generated between the model and the server content and changes are applied to make the structure on the server be the same as in the model and vice versa.
Understanding that fundamental difference answer all your questions above.

Creating a database with MySQL Workbench from existing schema/model

I built a database schema (or Model?) with MySQL Workbench. I'd like to now make it into an actual database.
I've seen Forward and Reverse engineer options and can't find a clear answer on if either are what I need.
How can I turn this into an actual database?
This for mysql workbench version 6.0 and for exporting a schema.
Select tab MySQL Model
Select File->Export->Forward Engineer SQL Create
Place a file name to be exported in the Output SQL Script File, choose your options, next
Export MySQL table Objects,
filter tables
Then a file is created which you can import to your database and it creates schemas if not exists, creates tables if not exists.
In the case of models, you need to pay, many bucks, for a tool that creates schemas, tables, indexes, cascading, and all stuff associated to an existing data model.
In order to realize a modeled schema structure on a real server you would use either forward engineering or synchronization. The first is if you have just the model and want it to create all the objects in the target schema(s). Synchronization on the other hand is a means to synchronize your model and an existing schema (two-way). That is, objects not existing or changed in your model are created or adjusted on the server and vice versa. There's no need to create a separate SQL script and apply that manually.
For both action see the Database menue in MySQL Workbench when a model is open.
The official documentation has a relevant article. http://dev.mysql.com/doc/workbench/en/wb-getting-started-tutorial-creating-a-model.html
Jump to step 11.
As of MySQL Workbench 8.0, go to the menu item Database > Forward Engineer. After specifying your database connection and model export options, you’ll be able to create the database you have designed.
See MySQL Workbench Manual :: 9.4.1.2 Forward Engineering to a Live Server for details.

mysql worbench. how to create database if I have model

I am novice in mysql server.
I use latest version of worbench.
using designer I created model:
But in databases I don't see my model:
I bad in mysql termins But I want to get so thing where I can insert data to Student and Group tables.
Modeling is more an abstract work to develop your schema structure systematically. It helps you to define needed objects, their relationships, users etc. that are needed. A model however has no data or any real representation of the objects it contains.
In order to use the objects you have to bring them on a real server. There are different ways to accomplish that, for instance you can forward engineer your model to a server (see Database menu). You have to select (or create) a connection to a server of your choice and let MySQL Workbench generate and apply a script to generate all the objects. Once this is done you can open those objects in the SQL IDE to fill them with data or work on them.
MySQL Workbench also has a synchronization feature that you can use after forward engineering. It's a two-way sync that allows to apply changes in your model to the schema objects on your server and also take over any changes made there into your model. All that can be fine tuned in the sync wizard.

How to log mysql database structural changes

I'm working with a project which is using mysql as the database. The application is hosted with many clients and we are doing upgrades for the current live systems often.
There are some instances where the client has change the database structure(adding new tables) and causes some unexpected db crashes.
I need to log all the structural changes which were done at that database, so we can find the correct root cause for that. We can't do it 100% correct with diff tool because it will not show the intermediate changes.
I found http://www.liquibase.org/ tool but seems little bit complex.
Is there any well known technique or a tool to track database structural changes only.
well from mysql studio you can generate all object's schema definition and compare them with your standard schema definition and this way you can compare two database schema...
generate scrips of both database (One is client's Database and One is master copy database) and then compare it using file compare tool would be the best practice according to me because this way you can track which collumn was added, which column was deleted, which index was added like wise without any tool download.
Possiable duplication of Compare two MySQL databases ?
Hope this helps.
If you have an application for your clients to manage these schema changes, you can use a mechanism at application level. If you have a Python and Django-based solution, you could probably use South which provides schema change tracking and rollbacks.