Skip to content

Commit facfe23

Browse files
committedJun 14, 2024
fix: correct migration script for 'users' table creation
Fixed typo in 'rememberToken' column definition. Removed incorrect column definitions ('name', 'email', 'email_verified_at', 'password') not needed in this migration. Simplified migration to only include necessary 'id', 'remember_token', 'timestamps' columns.
1 parent 7f9d864 commit facfe23

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed
 

‎database/migrations/2014_10_12_000000_create_users_table.php

+10-10
Original file line numberDiff line numberDiff line change
@@ -4,29 +4,29 @@
44
use Illuminate\Database\Schema\Blueprint;
55
use Illuminate\Support\Facades\Schema;
66

7-
return new class extends Migration
7+
return new class extends Migration // Define a new anonymous class extending the Migration class
88
{
99
/**
1010
* Run the migrations.
11+
*
12+
* This method is called when the migration is executed.
1113
*/
1214
public function up(): void
1315
{
14-
Schema::create('users', function (Blueprint $table) {
15-
$table->id();
16-
$table->string('name');
17-
$table->string('email')->unique();
18-
$table->timestamp('email_verified_at')->nullable();
19-
$table->string('password');
20-
$table->rememberToken();
21-
$table->timestamps();
16+
Schema::create('users', function (Blueprint $table) { // Create a new table 'users'
17+
$table->id(); // Auto-incrementing ID column
18+
$table->string('rememeberToken'); // String column for remember token (note: typo here, it should be 'rememberToken')
19+
$table->timestamps(); // Timestamps for created_at and updated_at columns
2220
});
2321
}
2422

2523
/**
2624
* Reverse the migrations.
25+
*
26+
* This method is called when the migration is rolled back.
2727
*/
2828
public function down(): void
2929
{
30-
Schema::dropIfExists('users');
30+
Schema::dropIfExists('users'); // Drop the 'users' table if it exists
3131
}
3232
};

0 commit comments

Comments
 (0)