laravel数据迁移问题-创新互联
创建数据迁移错误集:
成都创新互联专注于企业网络营销推广、网站重做改版、徽州网站定制设计、自适应品牌网站建设、成都h5网站建设、成都做商城网站、集团公司官网建设、成都外贸网站制作、高端网站制作、响应式网页设计等建站业务,价格优惠性价比高,为徽州等各大城市提供网站开发制作服务。错误描述1:
[ErrorException] include(F:\phpStudy\WWW\blog\vendor\composer/../../database/migrations/2017_09_06_132637_create_ads_table.php): failed to open stream: No such file or directory在此错误之前使用php artisan make:migration create_ads_table命令(命令1)执行并创建成功,后来问了与创建数据模型一致就想到用php artisan make:model Ad --migration命令(命令2),所以把已有迁移文件及数据库追踪数据表删除,在执行命令2时产生错误。
解决方法:执行以下3个命令
第一步、 php artisan cache:clear //清楚缓存
F:\phpStudy\WWW\blog>php artisan cache:clear Cache cleared successfully.第二步、composer dump-autoload-o
F:\phpStudy\WWW\blog>composer dump-autoload -o Generating optimized autoload files第三步、composer update
F:\phpStudy\WWW\blog>composer update Loading composer repositories with package information Updating dependencies (including require-dev) Package operations: 0 installs, 22 updates, 0 removals - Updating symfony/css-selector (v3.3.5 => v3.3.8): Downloading (100%) - Updating symfony/polyfill-mbstring (v1.4.0 => v1.5.0): Loading from cache - Updating symfony/var-dumper (v3.3.5 => v3.3.8): Downloading (100%) - Updating symfony/routing (v3.3.5 => v3.3.8): Downloading (100%) - Updating symfony/process (v3.3.5 => v3.3.8): Downloading (100%) - Updating symfony/http-foundation (v3.3.5 => v3.3.8): Downloading (100%) - Updating symfony/event-dispatcher (v3.3.5 => v3.3.8): Downloading (100%) - Updating symfony/debug (v3.3.5 => v3.3.8): Downloading (100%) - Updating symfony/http-kernel (v3.3.5 => v3.3.8): Downloading (100%) - Updating symfony/finder (v3.3.5 => v3.3.8): Downloading (100%) - Updating symfony/console (v3.3.5 => v3.3.8): Downloading (100%) - Updating ramsey/uuid (3.6.1 => 3.7.0): Loading from cache - Updating symfony/translation (v3.3.5 => v3.3.8): Downloading (100%) - Updating league/flysystem (1.0.40 => 1.0.41): Loading from cache - Updating laravel/framework (v5.4.30 => v5.4.36): Downloading (100%) - Updating fzaninotto/faker (v1.6.0 => v1.7.1): Loading from cache - Updating nikic/php-parser (v3.0.6 => v3.1.1): Downloading (100%) - Updating psy/psysh (v0.8.10 => v0.8.11): Loading from cache - Updating phpdocumentor/reflection-docblock (3.2.0 => 4.1.1): Downloading (100%) - Updating phpspec/prophecy (v1.7.0 => v1.7.2): Downloading (100%) - Updating phpunit/php-token-stream (1.4.11 => 2.0.1): Downloading (100%) - Updating symfony/yaml (v3.3.5 => v3.3.8): Downloading (100%) Writing lock file Generating optimized autoload files > Illuminate\Foundation\ComposerScripts::postUpdate > php artisan optimize Generating optimized class loader The compiled services file has been removed.以上三步执行完,再次执行命令2即可成功创建模型与迁移文件。
另外有需要云服务器可以了解下创新互联cdcxhl.cn,海内外云服务器15元起步,三天无理由+7*72小时售后在线,公司持有idc许可证,提供“云服务器、裸金属服务器、高防服务器、香港服务器、美国服务器、虚拟主机、免备案服务器”等云主机租用服务以及企业上云的综合解决方案,具有“安全稳定、简单易用、服务可用性高、性价比高”等特点与优势,专为企业上云打造定制,能够满足用户丰富、多元化的应用场景需求。
分享名称:laravel数据迁移问题-创新互联
标题URL:http://scyanting.com/article/docpop.html