vendredi 3 mars 2017

How to use raw mysql statement in the migration file of laravel 5.4?

I have a mysql statement :

'SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";'

I want to run it in a migration file of laravel 5.4 ,but I don't konw what should to do?

The following is my migration file's partial content:

> public function up()
>     {
>         //
>         Schema::create('users', function (Blueprint $table) {
> 
>             // SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"
>             // todo 
> 
>             $table->engine = 'InnoDB';
>             $table->charset = 'utf8mb4';
>             $table->collation = 'utf8mb4_unicode_ci';
> 
>             $table->int('id',11)->comment('ID');
>             $table->string('name',50)->nullable()->comment('name');
>             $table->string('phone',20);
>             ...

Anyone can help me?



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire