Foreign Key on Setup
Forum rules
Always add your Laravel, Aimeos and PHP version as well as your environment (Linux/Mac/Win)
Spam and unrelated posts will be removed immediately!
Always add your Laravel, Aimeos and PHP version as well as your environment (Linux/Mac/Win)
Spam and unrelated posts will be removed immediately!
Re: Foreign Key on Setup
Ok. I dropped all the tables and re-ran php artisan migrate.
I then ran
php artisan aimeos:setup --option=setup/default/demo:1
and got the error message
Aimeos\MW\DB\Exception : SQLSTATE[HY000]: General error: 1005 Can't create table `tdbhosti_demoshop`.`users_address` (errno: 150 "Foreign key constraint is incorrectly formed")
I then ran
php artisan aimeos:setup --option=setup/default/demo:1
and got the error message
Aimeos\MW\DB\Exception : SQLSTATE[HY000]: General error: 1005 Can't create table `tdbhosti_demoshop`.`users_address` (errno: 150 "Foreign key constraint is incorrectly formed")
Re: Foreign Key on Setup
sorry I should have mentioned I changed the structure of user so id was unsigned
Re: Foreign Key on Setup
I have done that - redone the migration - changed the unsigned on users.
When I run
php artisan aimeos:setup --option=setup/default/demo:1
I get
Aimeos\MW\DB\Exception : SQLSTATE[HY000]: General error: 1005 Can't create table `tdbhosti_demoshop`.`users_address` (errno: 150 "Foreign key constraint is incorrectly formed")
When I run
php artisan aimeos:setup --option=setup/default/demo:1
I get
Aimeos\MW\DB\Exception : SQLSTATE[HY000]: General error: 1005 Can't create table `tdbhosti_demoshop`.`users_address` (errno: 150 "Foreign key constraint is incorrectly formed")
Re: Foreign Key on Setup
Please make sure the users.id and user_address.parentid columns are of the same type and length:
https://stackoverflow.com/questions/843 ... rmed-error
https://stackoverflow.com/questions/843 ... rmed-error
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, give us a star
If you like Aimeos, give us a star
Re: Foreign Key on Setup
They are:
users:
id` int(10) unsigned NOT NULL AUTO_INCREMENT,
users_address
`parentid` int(10) unsigned NOT NULL,
The only difference is auto increment
users:
id` int(10) unsigned NOT NULL AUTO_INCREMENT,
users_address
`parentid` int(10) unsigned NOT NULL,
The only difference is auto increment
Re: Foreign Key on Setup
You can try
to show the last InnoDB foreign key error. This can maybe yield more information about the problem:
https://mariadb.com/kb/en/library/show- ... db-status/
Code: Select all
SHOW ENGINE INNODB STATUS
https://mariadb.com/kb/en/library/show- ... db-status/
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, give us a star
If you like Aimeos, give us a star
Re: Foreign Key on Setup
Same reply as the laravel error
Re: Foreign Key on Setup
you should go to table `users` then change the type of table from MyISAM to InnoDB, then it will be solved!