新增了字段 用什么命令可以让数据库增加字段喃
比如我在UP 方法里面增加了 username 这个字段 怎么做可以让数据库增加这个字段 不会影响 数据库之前的数据
public function up()
{
Schema::create('users', function (Blueprint $table) {
$table->id();
$table->string('name');
$table->string('email')->unique();
$table->timestamp('email_verified_at')->nullable();
$table->string('password');
$table->string('username');
$table->rememberToken();
$table->timestamps();
});
}
推荐文章: