为什么在使用migrate:fresh或其他迁移命令时会删除laravel应用程序迁移文件?

6 浏览
0 Comments

为什么在使用migrate:fresh或其他迁移命令时会删除laravel应用程序迁移文件?

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、admin_table、volunteers_table、opinions_table 和 contact_table,但是当我使用命令 php artisan migrate:fresh 时,它会自动创建上述所有的迁移,包括 messages_table,favorites_table 和其它表。我不知道这些来自哪里和如何迁移……

为什么会出现这个问题,基本上我是在 Laravel 应用程序中使用 Chatify 实时聊天包,以上所有的消息、收藏和头像表都是该包的一部分,但我已经从 laravel 应用程序中删除了所有的文件和文件夹……那么为什么这些迁移现在还在被创建呢?有谁可以帮助我解决问题吗?

admin 更改状态以发布 2023年5月21日
0
0 Comments

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

如你所见,这里是包存储库

https://github.com/munafio/chatify

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

在这里你可以找到一个关于如何正确地删除包的问题,可能值得一看

如何使用 composer 从 Laravel 中删除一个包?

0