In Laravel, how does one modify the database table definition file to make it take effect?

Source: Internet
Author: User
Tags table definition
For example, if you have a file 2016_06_21_200145_create_notes_table.php and modify the content, it will take effect if you manually rename the number 200145 and then execute phpartisanmigrate. For example, a file 2016_06_21_200145_create_notes_table.php, If I manually rename and modify the modified content 200145Execute this number again Php artisan migrateYes, but I don't know if this rule works.

Reply content:

For example, a file2016_06_21_200145_create_notes_table.php, If I manually rename and modify the modified content200145Execute this number againPhp artisan migrateYes, but I don't know if this rule works.

Every time you execute php artisan migrate, the migrate file will be recorded in the migrations table in the database. changing the file name is equivalent to creating a new file.

If you want to modify the table after creating the table, you can use the 2016_06_21_222145_update_notes_table.php file to change the table structure,
You can modify the table structure multiple times by adding the year, month, and Day (2016_06_21_232145_update_notes_table20160621.php) after the table.

Note that the modified date and random number must be sequential.

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: 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.