Yii 2 Migrations - Should I use migrations exclusively?

Hi People,

If I am using Yii2 Migrations, should I them use it exclusively in my project? Or can/should you mix and match it with something like PhpMyAdmin?

Cheers!

it all depends on you.

i’m always use migrations. it very useful for develop in team.

also full usage of migrations guarantees easy project installation

I use migrations exclusively :)

It is the only way to ensure that you can modify / evolve your database schema without breaking things and while keeping a record of all changes (source control).

I have a habit of testing if I can migrate all the way down and all the way up at all times.

Helps me to discover bugs and make sure that the application is installable.

In addition, the migrations are great documentation. ;)

I only use Phpmyadmin when I want to check that my migration scripts are doing what they are supposed to do - as a dev tool.

Or for trying out new things.

Hi,

In General:

Migrations are a "can" no "must" so it is your decision.

When you are coding alone and you are sure your project will use a specific DB (like mysql) and that will never change. You could of course create everything with phpMyAdmin and just export the completed structure as .sql file.

BUT: when you start using migrations - I would stick with it for obvious reasons like:

Every structure change you do in phpMyAdmin will not be covered by your project migrations.

Which makes the migrations pretty much useless. ;)

So like jacmoe said:

I personally only use migrations…

And have phpMyAdmin installed for quick checks / changes.

But every single structure change is coded in my migrations.

Regards

Thanks for the quick and helpful replies.

I thought I should be using it exclusively, but wasn’t sure if I should be aware of any shortcomings, either in the concept or in Yii2 specifically.

I like this, I could create a junction table for example and under ‘Designer’ I was able to ‘see’ the relations.

Thanks again!