作者:手机用户敬怡 | 来源:互联网 | 2023-10-12 12:33
IamnewtoLaravelfromcodeigniterandIamLOVINGTHEFRAMEWORK!Mylifeissomucheasiernow.
I am new to Laravel from code igniter and I am LOVING THE FRAMEWORK! My life is so much easier now.
我是代码点火器的Laravel新手,我喜欢框架!我的生活现在变得如此简单。
I have created a table with columns using php artisan and entered some test data. I now want to add a few new columns to the database without affecting the current data, and setting the new fields to be null.
我使用php artisan创建了一个包含列的表,并输入了一些测试数据。我现在想要在不影响当前数据的情况下向数据库添加一些新列,并将新字段设置为null。
My inital thought was to enter a new field in the database migrate file and the run "php artisan migrate", but this just gave me the message "nothing to migrate" and did enter the new column in my database.
我的初衷是在数据库迁移文件和运行“php artisan migrate”中输入一个新字段,但这只是给了我“无需迁移”的消息,并确实在我的数据库中输入了新列。
Here is my database migrate file:
这是我的数据库迁移文件:
increments('id');
$table->string('name');
$table->string('title');
$table->timestamps();
});
}
public function down()
{
Schema::drop('festivals');
}
}
1 个解决方案