为啥在使用 migrate:fresh 或其他时在 laravel 应用程序迁移中删除了迁移

Posted

技术标签:

【中文标题】为啥在使用 migrate:fresh 或其他时在 laravel 应用程序迁移中删除了迁移【英文标题】:Why Deleted migration in laravel app migrate when using migrate:fresh or others为什么在使用 migrate:fresh 或其他时在 laravel 应用程序迁移中删除了迁移 【发布时间】:2020-08-15 20:16:35 【问题描述】:

CMD 命令结果:

PS D:\WampDatabase\www\PakistanBloodDonors> php artisan migrate                                                         Migrating: 2014_10_12_000000_create_users_table
Migrated:  2014_10_12_000000_create_users_table (0.37 seconds)
Migrating: 2014_10_12_100000_create_password_resets_table
Migrated:  2014_10_12_100000_create_password_resets_table (0.26 seconds)
Migrating: 2019_09_22_192348_create_messages_table
Migrated:  2019_09_22_192348_create_messages_table (0.31 seconds)
Migrating: 2019_10_16_211433_create_favorites_table
Migrated:  2019_10_16_211433_create_favorites_table (0.19 seconds)
Migrating: 2019_10_18_223259_add_avatar_to_users
Migrated:  2019_10_18_223259_add_avatar_to_users (0 seconds)
Migrating: 2019_10_20_211056_add_messenger_color_to_users
Migrated:  2019_10_20_211056_add_messenger_color_to_users (0.19 seconds)
Migrating: 2019_10_22_000539_add_dark_mode_to_users
Migrated:  2019_10_22_000539_add_dark_mode_to_users (0.14 seconds)
Migrating: 2019_10_25_214038_add_active_status_to_users
Migrated:  2019_10_25_214038_add_active_status_to_users (0.28 seconds)
Migrating: 2020_03_25_130425_create_admins_table
Migrated:  2020_03_25_130425_create_admins_table (0.28 seconds)
Migrating: 2020_04_24_043508_create_opinions_table
Migrated:  2020_04_24_043508_create_opinions_table (0.12 seconds)
Migrating: 2020_04_27_034017_create_volunteers_table
Migrated:  2020_04_27_034017_create_volunteers_table (0.1 seconds)
Migrating: 2020_04_27_145232_create_contacts_table
Migrated:  2020_04_27_145232_create_contacts_table (0.08 seconds)

问题是我在 laravel 迁移文件夹中只有 users_table 、admins_table 、volutors_table 、 opinion_table 和 contact_table .. 但是当我使用命令php artisan migrate:fresh然后它会创建上面的所有迁移,其中自动包含messages_table、favorites_table 和其他表。 .我不知道这些从哪里来并迁移...

为什么这个问题基本上会产生?有谁知道吗?

【问题讨论】:

【参考方案1】:

正如你所说,它是 chatify 迁移,原因是你没有正确删除所有文件,你应该在你的供应商或其他地方查找,你会找到 chatify 文件夹然后删除它

正如你在包仓库中看到的那样

https://github.com/munafio/chatify

你会发现数据库进入它你会发现迁移和它就像你的应用程序创建的表一样

在这里您可以找到有关如何正确删除软件包的问题,​​看看可能会很好

How to remove a package from Laravel using composer?

【讨论】:

以上是关于为啥在使用 migrate:fresh 或其他时在 laravel 应用程序迁移中删除了迁移的主要内容,如果未能解决你的问题,请参考以下文章

外键约束错误地形成了laravel

在引用其他表时在单个表上使用Delete查询

为啥在获取系统时间时在这里使用`atomic_signal_fence`

为啥在使用 Promise 时在类方法中未定义“this”? [复制]

为啥在设置 Mongoose 连接时在 .then() 中使用 console.log() 时不打印?

为啥在使用带有量词的字符类时在反向引用中捕获最右边的字符?