الملفات
Tabeley-v0.0a/database/migrations/2026_02_13_074913_update_users_table.php
Abdul Kareem 749b083a1f
فشلت بعض الفحوصات
Deploy Backend / deploy (push) Has been cancelled
Migrate backend stack to PostgreSQL
2026-02-16 21:03:30 +03:00

30 أسطر
794 B
PHP

<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
public function up(): void
{
Schema::table('users', function (Blueprint $table) {
// نحذف name الافتراضي
$table->dropColumn('name');
// نضيف الحقول تبع مشروعنا
$table->string('first_name');
$table->string('last_name');
$table->string('phone')->unique();
});
}
public function down(): void
{
Schema::table('users', function (Blueprint $table) {
$table->string('name');
$table->dropColumn(['first_name', 'last_name', 'phone']);
});
}
};