为什么我设置了某个字段类型为timestamps,但是他并没有像我预期的一样在更新或者添加的时候自动填充当前时间戳?
还有我用Laravel的migrate生成的数据表也一样,生成的表里面那个timestamps字段根本不起效果。是怎么回事?
这是migration文件
<?php use Illuminate\Database\Schema\Blueprint; use Illuminate\Database\Migrations\Migration; class CreateEquip extends Migration { /** * Run the migrations. * * @return void */ public function up() { Schema::create('equip', function (Blueprint $table) { // $table->increments('id'); $table->smallInteger('equip_id')->unsigned()->comment('装备id'); $table->string('eqiup_name')->comment('装备名称'); $table->string('eqiup_desc')->comment('装备描述'); $table->timestamps(); $table->primary('equip_id'); }); } /** * Reverse the migrations. * * @return void */ public function down() { // } }
每个人都需要一台速度更快、更稳定的 PC。随着时间的推移,垃圾文件、旧注册表数据和不必要的后台进程会占用资源并降低性能。幸运的是,许多工具可以让 Windows 保持平稳运行。
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号