You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
php artisan migrate command fails for MariaDB, but working fine for MySQL.
I'd tried to migrate from MySQL to MariaDB and I stuck because I can't execute Laravel migrations.
Fails with error like SQLSTATE[HY000]: General error: 1025 Error on rename of './db/articles' to './db/#sql2-1-11c' (errno: 168 "Unknown (generic) error from engine") (SQL: alter table `articles` add constraint `articles_user_id_foreign` foreign key (`user_id`) references `users` (`id`) on delete cascade)
This can be fixed by wrapping all the code above with:
Schema::disableForeignKeyConstraints();
// all the code above
Schema::enableForeignKeyConstraints();
which is not so good, but something.
But in the next migration file, I have a code like
Which fails with a different error SQLSTATE[HY000] [2002] Connection refused (SQL: alter table `article_tag` add primary key `article_tag_article_id_tag_id_primary`(`article_id`, `tag_id`))
And laradock_mariadb_1 container crashes and I have to remove .laradock/data/mariadb folder to get it working again
Expected Behavior:
Alter SQL queries for MariaDB working as expected, the same as for MySQL, so that it's possible to use MariaDB
Context information:
Output of git rev-parse HEAD
c670d5f98b88aedae8fff4db77790203c0a9cbca
Output of docker version
Client: Docker Engine - Community
Version: 19.03.5
API version: 1.40
Go version: go1.12.12
Git commit: 633a0ea
Built: Wed Nov 13 07:22:37 2019
OS/Arch: windows/amd64
Experimental: false
Server: Docker Engine - Community
Engine:
Version: 19.03.5
API version: 1.40 (minimum version 1.12)
Go version: go1.12.12
Git commit: 633a0ea
Built: Wed Nov 13 07:29:19 2019
OS/Arch: linux/amd64
Experimental: false
containerd:
Version: v1.2.10
GitCommit: b34a5c8af56e510852c35414db4c1f4fa6172339
runc:
Version: 1.0.0-rc8+dev
GitCommit: 3e425f80a8c931f88e6d94a8c831b9d5aa481657
docker-init:
Version: 0.18.0
GitCommit: fec3683
Output of docker-compose version
docker-compose version 1.25.4, build 8d51620a
docker-py version: 4.1.0
CPython version: 3.7.4
OpenSSL version: OpenSSL 1.1.1c 28 May 2019
System info: Mac, Windows or Linux. Include which disto/version
Windows 10
Steps to reproduce the issue:
Create a project based on laradock + Laravel 6.2 with MySQL DB
Change DB_HOST to mariadb, change PMA_DB_ENGINE to mariadb
3. docker-compose up -d nginx mariadb phpmyadmin
create db using artisan command or using PhpMyAdmin
php artisan migrate
Stacktrace & Additional info:
1) **Laravel version**: 6.2
2) The same behavior if I run queries using PhpMyAdmin
3) MariaDB image version 10.4.12, also tried next versions: 10.1, 10.2, 10.5.1-bionic
4) logs
Description:
php artisan migrate
command fails for MariaDB, but working fine for MySQL.I'd tried to migrate from MySQL to MariaDB and I stuck because I can't execute Laravel migrations.
Each migration contains code like
Fails with error like
SQLSTATE[HY000]: General error: 1025 Error on rename of './db/articles' to './db/#sql2-1-11c' (errno: 168 "Unknown (generic) error from engine") (SQL: alter table `articles` add constraint `articles_user_id_foreign` foreign key (`user_id`) references `users` (`id`) on delete cascade)
This can be fixed by wrapping all the code above with:
which is not so good, but something.
But in the next migration file, I have a code like
Which fails with a different error
SQLSTATE[HY000] [2002] Connection refused (SQL: alter table `article_tag` add primary key `article_tag_article_id_tag_id_primary`(`article_id`, `tag_id`))
And laradock_mariadb_1 container crashes and I have to remove .laradock/data/mariadb folder to get it working again
Expected Behavior:
Alter SQL queries for MariaDB working as expected, the same as for MySQL, so that it's possible to use MariaDB
Context information:
Output of
git rev-parse HEAD
Output of
docker version
Output of
docker-compose version
System info: Mac, Windows or Linux. Include which disto/version
Steps to reproduce the issue:
3.
docker-compose up -d nginx mariadb phpmyadmin
Stacktrace & Additional info:
laradock_mariadb_1.log
laradock_mariadb_1_rename.log
The text was updated successfully, but these errors were encountered: