ybr-nx / laravel-mariadb

Add MariaDB JSON select support to Laravel
95 stars 7 forks source link

Fails when attempting to create a json column #18

Closed alar77 closed 4 years ago

alar77 commented 4 years ago

I tried adding in SchemaGrammar.php

 /**
 * Create the column definition for a json type. 
 * 
 * @param  \Illuminate\Support\Fluent  $column 
 * @return string 
 */
protected function typeJson(Fluent $column)
{
    return 'text';
}

/**
 * Create the column definition for a jsonb type.
 *
 * @param  \Illuminate\Support\Fluent  $column
 * @return string
 */
protected function typeJsonb(Fluent $column)
{
    return 'text';
}

but then column are no longer seen as json and the magic doesnt happens

alar77 commented 4 years ago

Well, rechecked, The issue is that you need your mariadb to be at list 10.2. My bad