“Migrasi Laravel Enum” Kode Jawaban

Laravel enum migrasi contoh

$table->enum('animal_type',['cat','dog','unknown'])->default('unknown');
Matio

Migrasi Laravel Enum

Add Laravel enmu migration : 
------------------------------
$table->enum('question_type', ['objective', 'subjective', 'multiple_choice']);

Update Laravel enum migration :
---------------------------------
DB::statement("ALTER TABLE users CHANGE COLUMN permissions permissions ENUM('admin', 'user', 'candidate') NOT NULL DEFAULT 'user'");
Lokesh003Coding

Migrasi Laravel - Perbarui Opsi Enum

DB::statement("ALTER TABLE users CHANGE COLUMN permissions permissions ENUM('admin', 'user', 'candidate') NOT NULL DEFAULT 'user'");
Scary Skimmer

Migrasi Laravel Enum

<?php

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

class UpdateRoleColumn extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        //
        \DB::statement("ALTER TABLE users MODIFY COLUMN role ENUM('1','2','3')");
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        //
    }
}
Adnan Zaheer

Migrasi Laravel Enum

 \DB::statement("ALTER TABLE users MODIFY COLUMN role ENUM('1','2','3')");
Adnan Zaheer

Jawaban yang mirip dengan “Migrasi Laravel Enum”

Pertanyaan yang mirip dengan “Migrasi Laravel Enum”

Lebih banyak jawaban terkait untuk “Migrasi Laravel Enum” di PHP

Jelajahi jawaban kode populer menurut bahasa

Jelajahi bahasa kode lainnya