vanilophp / demo

Vanilo Demo Application
https://vanilo.io/docs/
190 stars 54 forks source link

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

Closed j-dohnalek closed 5 years ago

j-dohnalek commented 5 years ago

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 autoincrement primary key, `model
typevarchar(191) not null,model_idbigint unsigned not null,collecti
on_namevarchar(191) not null,namevarchar(191) not null,file_namev archar(191) not null,mime_typevarchar(191) null,diskvarchar(191) no t null,sizeint unsigned not null,manipulationsjson not null,custo
m_propertiesjson not null,responsive_imagesjson not null,order_colu
mnint unsigned null,created_attimestamp 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

fulopattila122 commented 5 years ago

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.

fwwkol commented 5 years ago

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.

fulopattila122 commented 5 years ago

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

fwwkol commented 5 years ago

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

fulopattila122 commented 5 years ago

@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.