Home > Software engineering >  Do I need to create DB migration, if I have a designed DB in MySQL?
Do I need to create DB migration, if I have a designed DB in MySQL?

Time:08-22

I designed a database in MYSQL. Now I want to connect that with my Laravel application. But after researching, I understand that I need to migrate the database into Laravel by creating migration tables. But doing the same thing that I did in MySQL is tedious. I think there is another way to do the stuff. After searching I got this article from stackoverflow, but this is related to yii framework. I think someone knows here the solution of my problem.

CodePudding user response:

I don't see a problem here, you can just connect Laravel to your DB (by editing your .env file) without any problems, migration files are just an easier way to design and implement your tables (also altering your tables' scheme on production is a very useful usage for migrations), but with that being done then no further actions required, and you are good to go!

CodePudding user response:

it's pretty obvious, you can update the database setting in the .env file and use DB::table('your_table_name') and get whatever query you want.

CodePudding user response:

If you have created database and also tables, you don't need to create migration. Actually migration is because you can create tables more fast with migrations

  • Related