您好,请阅读https://laravel.com/docs/5.4/migrations中包含的所有文档.
Is there a way on how to migrate a certain migration file (1 migration only), cause right now every time there is a change I use php artisan migrate:refresh
and all fields are getting reset.
您好,请阅读https://laravel.com/docs/5.4/migrations中包含的所有文档.
Is there a way on how to migrate a certain migration file (1 migration only), cause right now every time there is a change I use php artisan migrate:refresh
and all fields are getting reset.
首先,您应该为表创建一个migration
文件,如:
public function up()
{
Schema::create('test', function (Blueprint $table) {
$table->increments('id');
$table->string('fname',255);
$table->string('lname',255);
$table->rememberToken();
$table->timestamps();
});
}
在migrations文件夹中创建test文件夹后,然后在test文件夹中移动/复制新创建的migration,并在terminal/cmd文件夹中运行以下命令,如:
php artisan migrate --path=/database/migrations/test/