- Forums
- laravel
- Laravel Database Migrate Table - Adding A Migration 3 Very Simple Steps
Laravel Database Migration - Adding A Migration 3 Very Simple Steps [5175], Last Updated: Mon Jun 24, 2024
jj
Sat Jul 29, 2023
0 Comments
254 Visits
addin a migration to laravel app project
1. Command: $ php artisan make:migration create_user_[NAME]_table
2. open create_user_[NAME]_table in database/migrations/...create_user_[NAME]_table.php
3. Add table columns
Available Column Types
https://laravel.com/docs/10.x/migrations#available-column-types
Example:
public function up()
{
Schema::create('tasks', function (Blueprint $table) {
$table->id();
$table->timestamps();
$table->longText('task');
$table->integer('status');
$table->integer('points');
});
}