Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

laravel create table 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();
    }
}
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #laravel #create #table #exists
ADD COMMENT
Topic
Name
6+6 =