2023_05_16_062924_alter_users_table2.php 1.34 KB
<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

return new class extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::table('users', function (Blueprint $table) {
            $table->string('telephone', 50)->nullable(true);
            $table->string('surname', 255)->nullable(true);
            $table->string('name_man', 255)->nullable(true);
            $table->string('surname2', 255)->nullable(true);
            $table->boolean('is_worker')->default(false);
            $table->boolean('is_lookin')->default(true);
            $table->boolean('is_message')->default(true);
            $table->boolean('is_public')->default(true);
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::table('users', function (Blueprint $table) {
            $table->dropColumn('telephone');
            $table->dropColumn('surname');
            $table->dropColumn('name_man');
            $table->dropColumn('surname2');
            $table->dropColumn('is_worker');
            $table->dropColumn('is_message');
            $table->dropColumn('is_lookin');
            $table->dropColumn('is_public');
        });
    }
};