D
D
Dmitry2016-01-12 23:28:25
MySQL
Dmitry, 2016-01-12 23:28:25

Is it possible to migrate a DB model from workbench to Yii2 migrations?

Can yii2 somehow pick up the db model I created in workbench? I would like to automate the creation of migrations, because. while I'm learning, it's convenient to edit the database model directly in the workbench, for every sneeze, I don't want to create a migration by hand.
Perhaps the answer is in a similar topic, but I would like to learn from professionals.
How to migrate MySql workbench to laravel migration?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Andrey, 2016-01-13
@VladimirAndreev

I wouldn't bother with migrations just yet.
is gii which generates models under tables of an existing DB.
and migrations, I change the tables in HeidiSQL, and then I add the ALTER code formed by it to the migration (when changing / adding fields).
of course, there are methods that allow you to write less sql code, but for now you can just write ALTER queries and execute them as sql in the migration body

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question