“Laravel Enum Migration” Code-Antworten

Beispiel

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

Laravel Enum Migration

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

Laravel -Migration - Aktualisierung der Enumoptionen

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

Laravel Enum Migration

<?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

Laravel Enum Migration

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

Ähnliche Antworten wie “Laravel Enum Migration”

Fragen ähnlich wie “Laravel Enum Migration”

Weitere verwandte Antworten zu “Laravel Enum Migration” auf PHP

Durchsuchen Sie beliebte Code-Antworten nach Sprache

Durchsuchen Sie andere Codesprachen