Support the ongoing development of Laravel.io →
Configuration Database
Last updated 2 years ago.
0

create a new db and run artisan migrate on that and check if the tables are created .. just for debugging this issue/

0

Tried that, it once again created just the default tables. Looking at mysql logs i realized that it is trying to set 'auto_increment primary key' on every integer column.

Here's how the query ends:

68 Prepare create table projects (id int unsigned not null auto_increment primary key, name varchar(256) not null, col1 int not null auto_increment primary key, col2 int not null auto_increment primary key, col3 int not null auto_increment primary key, col4 int not null auto_increment primary key, col5 int not null auto_increment primary key, col6 int not null auto_increment primary key, created_at timestamp default 0 not null, updated_at timestamp default 0 not null) default character set utf8 collate utf8_unicode_ci

68 Close stmt

68 Quit

The stmt is never executed, probably because of the primary key thing. Am I missing something obvious here?

Last updated 8 years ago.
0

I figured it out. Integers cannot have a length parameter, which was causing Laravel to interpret the value of '4' as TRUE and set column as primary key. Removing the parameter solved the problem.

It would be nice if this produced an error message.

Last updated 8 years ago.
0

Sign in to participate in this thread!

Eventy

Your banner here too?

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2024 Laravel.io - All rights reserved.