Why should I use migration to operate databases when creating tables in laravel?

Source: Internet
Author: User
The local server is: wampServer creates a laravel5 project using the composer command in the www directory. The version is 5.1.26. In many laravel tutorials, data tables are created using commands, then perform data migration and filling, which is directly related to phpMyAdmin or NavicatP...

The local server is wampServer.
Create a laravel5 project using the composer command in the www directory. The version is 5.1.26.
In many laravel tutorials, you can use commands to create data tables and then perform data migration and filling. Is this different from directly creating tables in phpMyAdmin or Navicat Premium? If so, what are the benefits of using laravel's migration?

After sending this question, understand the laravel series of JellyBool tutorials (https://laravist.com/), here there is a text version (https://jellybool.com/), found the answer in tutorial 4:
You can regard Migration as a database version management tool, such as git's version management for project files, rollback, reset, and so on (view specific commands through the php artisan command)
In fact, using Migration to create a table is the same as creating a table directly. The difference is that using Migration has additional database management functions: rollback, resetting, and updating.

Reply content:

The local server is wampServer.
Create a laravel5 project using the composer command in the www directory. The version is 5.1.26.
In many laravel tutorials, you can use commands to create data tables and then perform data migration and filling. Is this different from directly creating tables in phpMyAdmin or Navicat Premium? If so, what are the benefits of using laravel's migration?

After sending this question, understand the laravel series of JellyBool tutorials (https://laravist.com/), here there is a text version (https://jellybool.com/), found the answer in tutorial 4:
You can regard Migration as a database version management tool, such as git's version management for project files, rollback, reset, and so on (view specific commands through the php artisan command)
In fact, using Migration to create a table is the same as creating a table directly. The difference is that using Migration has additional database management functions: rollback, resetting, and updating.

Use this migration
The advantage is that you can directly retain the structure information of the table below in your project, and because the subsequent SQL statements are actually generated, you do not want to switch from mysql to pqsql one day, sqlite and even oracle will generate table creation statements for you by ORM.
Then, you provide additional version control items to check whether you need these features for evaluation.

Of course, you can also use this tool to create tables in the way you are used.

Include schema into Version Control for easy tracking and deploy
And (as long as the content does not conflict) can be developed in parallel by multiple people

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.