基于laravel 的antvel 迁移数据出错

使用 php artisan migrate:refresh --seed 使用Antvel提供的填充器将演示数据插入数据库时,出现下面的错误:

[32mNothing to rollback.[39m

[37;41m                                                                                                                       [39;49m
[37;41m  [Illuminate\Database\QueryException]                                                                                 [39;49m
[37;41m  SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that  [39;49m
[37;41m   corresponds to your MariaDB server version for the right syntax to use near 'json null, `remember_token` varchar(1  [39;49m
[37;41m  00) null, `created_at` timestamp null, `upd' at line 1 (SQL: create table `users` (`id` int unsigned not null auto_  [39;49m
[37;41m  increment primary key, `nickname` varchar(255) not null, `email` varchar(255) not null, `password` varchar(60) not   [39;49m
[37;41m  null, `pic_url` varchar(255) null, `language` varchar(255) not null default 'en', `mobile_phone` varchar(255) null,  [39;49m
[37;41m   `work_phone` varchar(255) null, `website` varchar(255) null, `twitter` varchar(255) null, `facebook` varchar(255)   [39;49m
[37;41m  null, `description` varchar(255) null, `time_zone` varchar(255) null, `rate_val` int null, `rate_count` int null, `  [39;49m
[37;41m  role` enum('admin', 'business', 'nonprofit', 'person') not null default 'person', `type` enum('normal', 'trusted')   [39;49m
[37;41m  not null default 'normal', `verified` enum('yes', 'no') not null default 'no', `preferences` json null, `remember_t  [39;49m
[37;41m  oken` varchar(100) null, `created_at` timestamp null, `updated_at` timestamp null, `disabled_at` timestamp null, `d  [39;49m
[37;41m  eleted_at` timestamp null) default character set utf8 collate utf8_unicode_ci)                                       [39;49m
[37;41m                                                                                                                       [39;49m

[37;41m                                                                                                                       [39;49m
[37;41m  [Doctrine\DBAL\Driver\PDOException]                                                                                  [39;49m
[37;41m  SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that  [39;49m
[37;41m   corresponds to your MariaDB server version for the right syntax to use near 'json null, `remember_token` varchar(1  [39;49m
[37;41m  00) null, `created_at` timestamp null, `upd' at line 1                                                               [39;49m
[37;41m                                                                                                                       [39;49m

[37;41m                                                                                                                       [39;49m
[37;41m  [PDOException]                                                                                                       [39;49m
[37;41m  SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that  [39;49m
[37;41m   corresponds to your MariaDB server version for the right syntax to use near 'json null, `remember_token` varchar(1  [39;49m
[37;41m  00) null, `created_at` timestamp null, `upd' at line 1                                                               [39;49m
[37;41m                                                                                                                       [39;49m


处理方法:

database\migrations 目录,搜索下“json” 替换成string 就可以了


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值