作者:友尔哥_398 | 来源:互联网 | 2022-12-02 18:45
我在Laravel创建了一个应用程序.最初,我使用以下内容进行了迁移:
public function up()
{
Schema::create('kundens', function (Blueprint $table) {
$table->increments('id');
$table->timestamps();
$table->unsignedInteger('user_id');
$table->string('vorname');
$table->string('nachname');
$table->string('strasse');
$table->integer('plz');
$table->string('wohnort');
$table->string('mail');
$table->integer('telefon');
$table->string('geburtsdatum');
});
}
不,我想添加一些像kaufpreis或"modernisierung"的表.我在其他表下添加了它们,但是当我保存文件并在终端中写入时,我收到错误:
什么都没有迁移.
那么现在我如何添加一些表格以获取更多信息?
1> 小智..:
您应该为kaufpreis
和创建一个新的迁移modernisierung
.
kundens
已经运行的主要迁移(migrations
见表).
php artisan migrate:fresh
如果您在本地开发,也是一种选择.
与其他人/生产合作时不要这样做,因为它会擦除表并创建新表(数据将丢失)