Lumen-framework: Migration default value Error

Created on 17 Sep 2019  路  7Comments  路  Source: laravel/lumen-framework

  • Lumen Version: 6.0.2
  • PHP Version:7.3.9
  • Database Driver & Version: mysql 5.7

Description:

When create a column and set default value like this:

        Schema::create('users', function (Blueprint $table) {
            $table->increments('id');
            $table->string('username')->unique();
            $table->string('email')->unique();
            $table->string('password');
            $table->string('api_token', 80)->unique();
            $table->boolean('activated')->default(false);
            $table->timestamps();
        });

and run migrate command , have a error:

  SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your   
  MySQL server version for the right syntax to use near '('0'), `created_at` timestamp null, `updated_at` timestamp null) default charact'  
   at line 1 (SQL: create table `users` (`id` int unsigned not null auto_increment primary key, `username` varchar(255) not null, `email`   
  varchar(255) not null, `password` varchar(255) not null, `api_token` varchar(80) not null, `activated` tinyint(1) not null default ('0')  
  , `created_at` timestamp null, `updated_at` timestamp null) default character set utf8mb4 collate 'utf8mb4_unicode_ci')

and i think error is in activated column default value !

Most helpful comment

I think the issue related to laravel/framework #29943. Should be fixed in next release (current version is 6.0.2).

All 7 comments

I think the issue related to laravel/framework #29943. Should be fixed in next release (current version is 6.0.2).

Yes
I looked at https://github.com/illuminate/database and i see i fixed but not release new version i think

Have the same issue.

Same Problem with me too

There seems to be a fix already on the Laravel Framework for this, but not on Lumen yet.
https://github.com/laravel/framework/pull/29878

This should be fixed with https://github.com/laravel/framework/releases/tag/v6.0.3

Have you all tried doing a composer update to include this release?

I just saw the illuminate components haven't been tagged yet with 6.0.3. I'll try to get that fixed later today. Thanks for bringing this to our attention.

Going to close it since this is related to laravel/framework and not lumen.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

codercms picture codercms  路  4Comments

timrogers picture timrogers  路  3Comments

concept47 picture concept47  路  3Comments

patrikengborg picture patrikengborg  路  3Comments

rtheunissen picture rtheunissen  路  3Comments