简体   繁体   English

我们不能重写迁移表并重置迁移文件,而不使用列修饰符吗?

[英]Can't we rewrite migration table and reset the migration file instead of using column modifiers?

I'm a bit confused with this. 我对此有些困惑。 Can't we just rewrite the migration table and reset the migration instead of using modifying column modifiers? 我们不能只改写迁移表并重置迁移,而不是使用修改列修饰符吗? For eg. 例如。 $table->string('name', 50)->change(); can't we just change the size to 25 (say) and refresh the migration instead of using change()? 我们不能仅将大小更改为25(例如)并刷新迁移,而不是使用change()吗? What difference does it make? 有什么区别?

Yes, I just do this: 是的,我只是这样做:

php artisan migrate:refresh --seed

This will drop the tables, recreate them and populate them using your seeders. 这将删除表,重新创建它们,并使用播种器填充它们。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 无法使用laravel 5中的迁移向表中添加太多数据来添加新列 - Can't add a new column using migration in laravel 5 to table with too many data 为表中未使用的列重写旧的数据库迁移是否很好? - Is it good to rewrite your old db migration for unused column in your table? 我无法在Laravel中使用make:migration命令生成迁移文件 - I can't generate migration file with make:migration command in Laravel 如果迁移文件不存在但迁移表中的条目可用,我如何解决迁移问题 - How i can resolve migration issue if migration file does not exist but entry available in migration table Laravel迁移创建迁移表,而不是预期的用户 - Laravel migration creates migration table instead of users as expected 无法在Laravel中使用迁移将新列添加到表 - Unable to add new column to a table using migration in laravel 在现有表中添加列而不使用 Laravel 中的迁移 - Adding column in existing table without using migration in Laravel 将mysql表迁移到DBF文件 - Migration of mysql table to DBF file 带有流浪汉数据库迁移的Laravel 4“使用密码NO”重置 - Laravel 4 with vagrant database migration “using password NO” reset Laravel 迁移:使用 artisan 命令删除特定表并删除迁移文件 - Laravel migration: drop specific table and remove migration file using artisan command
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM