1/7
Looks like no tags are added yet.
Name | Mastery | Learn | Test | Matching | Spaced |
|---|
No study sessions yet.
A way to define and manage your database schema (tables and columns) using PHP files. They allow changes to be easily tracked and transferred across different environments (local, production).
What is the concept of Migrations?
database/migrations folder.
Location of Migration files
php artisan migrate (Executes the up() method in all unexecuted migration files).
Artisan command to run migrations
Defines the database schema changes to be applied
Purpose of the up() method in a migration
Defines the database changes to be reversed (e.g., dropping the table that was created in up()).
Purpose of the down() method in a migration
php artisan migrate:rollback
Artisan command to undo the last batch of migrations
Stores the history of which migrations have been executed, identified by their file name and a batch number.
Purpose of the migrations DB table
$table->timestamps();
Shorthand for created_at and updated_at columns