vanilophp/demo

errors when running "php artisan migrate --seed" while installing demo

Closed this issue · 5 comments

Following the demo setup command I get error when running "php artisan migrate --seed" the following is the output:

Migration table created successfully.

In Connection.php line 664:

SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error i
n your SQL syntax; check the manual that corresponds to your MariaDB server
version for the right syntax to use near 'json not null, custom_propertie s json not null, responsive_images json not n' at line 1 (SQL: create ta
ble media (id int unsigned not null auto_increment primary key, model_ type varchar(191) not null, model_id bigint unsigned not null, collecti on_name varchar(191) not null, name varchar(191) not null, file_name v
archar(191) not null, mime_type varchar(191) null, disk varchar(191) no
t null, size int unsigned not null, manipulations json not null, custo m_properties json not null, responsive_images json not null, order_colu mn int unsigned null, created_at timestamp null, updated_at timestamp
null) default character set utf8mb4 collate 'utf8mb4_unicode_ci')

In Connection.php line 452:

SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error i
n your SQL syntax; check the manual that corresponds to your MariaDB server
version for the right syntax to use near 'json not null, custom_propertie s json not null, responsive_images json not n' at line 1

if you require more information please let me know

https://vanilo.io/docs/0.3/installation#requirements

MariaDB does not support JSON fields and that is causing the problem.
You need a db engine that supports json fields like MySQL5.7+, PostgreSQL or even SQLite 3.9+.

The JSON field requirement originates from the underlying Spatie Media Library, but we'll most likely use JSON fields for the upcoming translations feature as well.

How to bypass the error? Uploaded into the server & once I added a product it is showing up these issues.

https://snag.gy/HbmNUZ.jpg -- See the screenshot plz. The requirements for media library and other things are in there but still can't make it work. I am using MySQL 5.7.

@fwwkol Looks like your migrations are not complete. What happens when running php artisan migrate?

Thanks for responding so quickly @fulopattila122. Here's the attached image that shows the error once the migration is going on. Like the way it is instructed in the DEMO page of Vanilo, I have done exactly the same.
migration-error-vanilo

@fwwkol You aren't usin MySQL 5.7 but MariaDB. See in the second line of the first red block on the image above. From the error message it's 99% that your MariaDB version is too low.

Check your DB engine version with mysql -V and make sure it fulfills the requirements. In case of MariaDB you need v10.2.7 or higher.

The JSON field requirement originates from the underlying Spatie Media Library, but we'll most likely use JSON fields for the upcoming translations feature as well.