当前位置:网站首页>laravel数据库
laravel数据库
2022-04-22 05:47:00 【klx2545845553】


php artisan migrate
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreateUuserTable extends Migration
{
/** * Run the migrations. * * @return void */
public function up()
{
Schema::create('uuser', function (Blueprint $table) {
$table->id();
$table->timestamps();
$table->string('name',20)->comment('用户名');
$table->string('password',50)->comment('用户密码');
$table->integer('age')->nullable()->comment('年龄');
});
}
/** * Reverse the migrations. * * @return void */
public function down()
{
Schema::dropIfExists('uuser');
}
}
版权声明
本文为[klx2545845553]所创,转载请带上原文链接,感谢
https://blog.csdn.net/klx2545845553/article/details/124306420









