首页 » PHP » 正文

Laravel migration timestamp字段由not null 改为 null

DB::statement("ALTER TABLE wechat_forms CHANGE expired_at expired_at TIMESTAMP NULL;");

Only the following column types can be "changed": bigInteger, binary, boolean, date, dateTime, dateTimeTz, decimal, integer, json, longText, mediumText, smallInteger, string, text, time, unsignedBigInteger, unsignedInteger and unsignedSmallInteger.

参考 https://laravel.com/docs/5.8/migrations#columns

发表评论