![]() ![]() Inside the up method is the schema builder that is used to create and manipulate tables. On the other hand, the down method should revert those changes to the database so whenever you rollback your migration, the down method should undo what the up method did. The up method should make changes to the database so whenever you migrate your database, whatever code is in the up method will be run. The code is a class with the same name ‘create student records’, and has two methods: up and down. In your text editor, open the newly created file under the migration folder: increments('id') To create a migration, just run the following command: php artisan make:migration create_student_records Open the terminal and choose the correct path, and you can use artisan to create that migration table with this command: php artisan migrate:install To get started with migrations, you need to setup Laravel migration. Assuming that our database is up and running. Also it provides a way of adding version control to your database. Migration is a process of managing your database by writing PHP rather than SQL. To view a help screen, simply precede the name of the command with “help” as shown: php artisan help migrate Migration To view a list of all available Artisan commands, you may use the list command: php artisan listĪll the commands come with a concise description of its arguments and options. It is driven by the powerful Symfony Console component. It provides a number of helpful commands to be used during the development of your application.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |