[英]Can i migrate one table without affecting my data in the database?
我问是否可以在不影响数据库中的数据的情况下进行一个表的迁移,因为每次刷新我的所有字段都会被重置。
When you run php artisan migrate
it would run any migrations that haven't yet been run and it wouldn't remove your existing data unless you're deleting columns. 当您运行php artisan migrate
,它将运行尚未运行的任何迁移,除非您删除列,否则它不会删除现有数据。 You could also run a specific single migration by adding the path to the file with the --path
parameter, eg php artisan migrate --path=database/migrations/2019_04_10_migration_name.php
. 您还可以通过使用--path
参数添加文件路径来运行特定的单个迁移,例如php artisan migrate --path=database/migrations/2019_04_10_migration_name.php
。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.