json field error


  • | 265 points

    can't create json field in migration

        Schema::create('variables', function (Blueprint $table) {
            $table->increments('id');
            $table->json('days');
            $table->json('hours');
        });
    

    [Illuminate\Database\QueryException]
    SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MariaDB
    server version for the right syntax to use near 'json not null, hours json not null) default character set utf8 collate utf8_un' at line 1 (
    SQL: create table variables (id int unsigned not null auto_increment primary key, days json not null, hours json not null) default char
    acter set utf8 collate utf8_unicode_ci)

    [PDOException]
    SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MariaDB
    server version for the right syntax to use near 'json not null, hours json not null) default character set utf8 collate utf8_un' at line 1


  • | 265 points

    nvm I used text


  • administrators
    | 66609 points

    @JackTimble : It's OK


Log in to reply
 

Looks like your connection to Laragon was lost, please wait while we try to reconnect.