简体   繁体   English

我无法在Laravel中使用make:migration命令生成迁移文件

[英]I can't generate migration file with make:migration command in Laravel

This happened to me a couple of months ago. 这发生在几个月前。 It might have happened in the process of a composer update, but I'm far from sure on that one. 这可能是在作曲家更新过程中发生的,但是我对此不确定。 I've even updated my project to Laravel 5.3 and it still I can not get make:migration to work through Artisan. 我什至将我的项目更新为Laravel 5.3,但仍然无法使make:migration通过Artisan工作。 No the project it updated to 5.4 and it still do not work. 没有将项目更新到5.4的项目,它仍然无法正常工作。

I've checked out this thread and I have the exact same problem. 我已经检查了这个线程 ,但我遇到了完全相同的问题。 The symptoms were exactly the same, however the OPs solutions did not work for me. 症状完全相同,但是OP解决方案对我不起作用。

  • I get no error or result in the terminal when running make:migrate. 运行make:migrate时,在终端上没有任何错误或结果。
  • I can generate any other file through Artisan it seems. 我可以通过Artisan生成任何其他文件。
  • I tried to create a new model and pass the -m along with it. 我试图创建一个新模型并将-m与它一起传递。 Didn't work. 没用
  • I've checked permissions (and even changed migration folder), but didn't help. 我已经检查了权限(甚至更改了迁移文件夹),但没有帮助。
  • If I create my own migration-file the rest of the process through artisan works fine (migrate, DB-manipulation etc). 如果我创建自己的迁移文件,则通过手工艺的其余过程都可以正常工作(迁移,DB操作等)。
  • I've tried with different terminals and computers. 我尝试了不同的终端和计算机。
  • Since project were upgraded and even reinstalled I fear it has nothing to do with the deep kernal. 由于项目已经升级甚至重新安装,我担心它与深层内核无关。 However maybe some sort of conflict from the higher level. 但是,也许高层会有某种冲突。
  • And in the last phase of my quest I tried to figure out what user interacting elements that can possibly effect the make:migration. 在我探索的最后阶段,我试图找出哪些用户交互元素可能会影响make:migration。 Nothing worked. 没事。

I searched the web without any solution, then I gave up on that project and started to make my own migration files. 我没有任何解决方案地在网上搜索,然后放弃了该项目,开始制作自己的迁移文件。 However I now got some new hope when I saw that other thread. 但是,当我看到另一个线程时,现在有了新的希望。

After some troubleshooting I finaly managed to figure out the problem. 经过一些故障排除后,我最终设法找出了问题所在。 I narrowed it down to have something to do with the config/app.php-file . 我将其范围缩小到与config / app.php-file有关 Seems I in this project had typed in: 看来我在这个专案中输入了:

'timezone' => ' UTC+2 ' '时区'=>' UTC + 2 '

This made creation of migration-files come to a halt without error messages. 这使得迁移文件的创建停止而没有错误消息。 And it effected only the creation of migration-files (at least what I noticed). 而且它影响迁移文件的创建(至少是我注意到的)。

I changed it to ' UTC ' and it worked liked a charm again. 我将其更改为“ UTC ”,它再次变得很有魅力。

Note: the 'UTC+2' worked in the application and I never saw any other indications of errors regarding the rest of the app.php-file, or in the application in general. 注意: “ UTC + 2”在应用程序中起作用,我再也没有看到关于app.php文件其余部分或一般应用程序中任何其他错误的迹象。

Solution: When I instead used the parameters from this site it all worked perfectly again. 解决方案:当我改用此站点中的参数时,它们又再次正常运行。

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM