Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migration default value Error #973

Closed
omid-reza opened this issue Sep 17, 2019 · 7 comments
Closed

Migration default value Error #973

omid-reza opened this issue Sep 17, 2019 · 7 comments

Comments

@omid-reza
Copy link

  • 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 !

@jsilalahi
Copy link

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

@omid-reza
Copy link
Author

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

@chimit
Copy link
Contributor

chimit commented Sep 19, 2019

Have the same issue.

@TawsifKarim
Copy link

Same Problem with me too

@abishekrsrikaanth
Copy link

There seems to be a fix already on the Laravel Framework for this, but not on Lumen yet.
laravel/framework#29878

@driesvints
Copy link
Member

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?

@driesvints
Copy link
Member

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants