Answers for "laravel migrate if not exists"

PHP
0

laravel migrate if not exists

if (!Schema::hasTable('tblCategory')) {
     Schema::create('tblCategory', function($table){
            $table->engine = 'InnoDB';
            $table->increments('CategoryID');
            $table->string('Category', 40);
            $table->unique('Category', 'tblCategory_UK_Category');
            $table->timestamps();
    }
}
Posted by: Guest on June-16-2021
0

laravel migrate if not exists

if (!Schema::hasTable('tblCategory'))
{
     Schema::create('tblCategory', function($table){
            //...
    }
}
Posted by: Guest on June-16-2021

Browse Popular Code Answers by Language