1 year ago

Migration json field

Posted 1 year ago by Nosean


i have a problem with json field migration. I get the following error message after confirming the migrate command:

   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 null, `is_active` tiny
int(1) not null default '0', `created_at` timestamp n' at line 1 (SQL: create table `roles` (`id` int unsigned not null auto_increment primary key, `name` varchar(191) not null, `slug` varchar(191) null, `description` text null, `permissions` json null, `is_act
ive` tinyint(1) not null default '0', `created_at` timestamp null, `updated_at` timestamp null) default character set utf8mb4 collate 'utf8mb4_unicode_ci')

my migration file:

 public function up()
        Schema::create('roles', function (Blueprint $table) {

Where is the problem ?

Please sign in or create an account to participate in this conversation.