<?php
 use Illuminate\Database\Schema\Blueprint; use Illuminate\Database\Migrations\Migration; class ModifyQuestion20200514 extends Migration { public function up() { ini_set("memory_limit", "-1"); set_time_limit(0); Schema::table('question', function (Blueprint $table) { $table->string('questionText', 2000)->nullable()->comment('问题（纯文本）'); }); foreach (\ModStart\Core\Dao\ModelUtil::all('question', [], ['id', 'question']) as $item) { \ModStart\Core\Dao\ModelUtil::update('question', $item['id'], [ 'questionText' => \ModStart\Core\Util\HtmlUtil::text($item['question']), ]); } } public function down() { } } 