Laravel How do I modify a database table definition file to make it effective?

Source: Internet
Author: User
Tags table definition
For example, if there is such a file 2016_06_21_200145_create_notes_table.php , modify the content after I if the manual rename 200145 to modify the number of the execution php artisan migrate is in effect, but I do not know that such rules are not standardized.

Reply content:

For example, if there is such a file 2016_06_21_200145_create_notes_table.php , modify the content after I if the manual rename 200145 to modify the number of the execution php artisan migrate is in effect, but I do not know that such rules are not standardized.

Every time you execute PHP artisan migrate, the execution migrate file is logged to the Migrations table in the database, and you change the file name to create a re-created file.

If you want to modify the table after you create the table, you can change the table structure by 2016_06_21_222145_update_notes_table.php file.
Modifying the table structure multiple times requires adding the preceding date (that is, 2016_06_21_232145_update_notes_table20160621.php) to the table, so that you can change the structure of the tables several times.

It is important to note that the date and the number of random numbers to be modified are in sequence.

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