- [Instructor] I'm back in MySQLWorkbench
to review the database structure
that was just created by Sequelize.
So open the shopper database and I open the tables
and there you now see that we have orders
in the order items table.
If I click on orders,
I can right click and select the table inspector,
and there I can select columns,
and I see the columns that were created.
You also see that there is a created at
and updated at column, very similar to Mongoose,
it's created automatically.
What it attempts is similar,
but it also has this foreign key
which is the key that points back to the order ID.
Let's look also at what are items in the table inspector,
and here we also see the columns that were created for us.
And that's all fine and interesting,
but I will show you something really cool now.
So I go to database and reverse engineer,
and there I select the stored connection.
So this is the connection are currently on.
I can leave everything as it is
and then I select continue
and then, again, continue,
and then I select shopper.
So that's the table that we want to reverse engineer,
whatever that means.
I click continue again.
I click continue again and then execute,
and then I click continue again and then close.
And now we end up on some sketching page
and if we scroll down we see that
MySQLWorkbench reverse engineered the structure for us
and let's turn it around.
And now you see that this is pretty much
the ERD diagram that I showed you before.
I mean, for two tables this is, of course,
still not completely exciting,
but imagine you model rather complex relationships
in Sequelize and you'd want to then figure out
how everything fits together,
then this reverse engineer is really, really useful
to understand what you just did.
Now with the models and the schemas and everything in place,
we can go ahead and implement the order service.