我正在与Laravel开发网站。我跑了composer dump-autoload
,它发生了一些错误信息,但我没有看到它。
之后,我在当前网站上发帖,但发生了db错误。
SQLSTATE[42S02]: Base table or view not found: 1051 Unknown table 'testdb.articles_e' (SQL: select articles_e.*, (select count(id) from votes_e where votes_e.article_id=articles_e.id and votes_e.up!=0) as up, `articles`.*, `article_tag`.`tag_id` as `pivot_tag_id`, `article_tag`.`article_id` as `pivot_article_id` from `articles` inner join `article_tag` on `articles`.`id` = `article_tag`.`article_id` where `article_tag`.`tag_id` = 9 and `h` = 0 order by `id` desc, `created_at` desc limit 32 offset 0)
composer.json就是这个。
composer.json
{
"name": "laravel/laravel",
"description": "The Laravel Framework.",
"keywords": ["framework", "laravel"],
"license": "MIT",
"type": "project",
"require": {
"php": ">=5.6.4",
"erusev/parsedown-extra": "0.7.1",
"laracasts/flash": "*.*.*",
"laravel/framework": "5.4.*",
"laravel/tinker": "~1.0"
},
"require-dev": {
"fzaninotto/faker": "~1.4",
"mockery/mockery": "0.9.*",
"phpunit/phpunit": "~5.7"
},
"autoload": {
"classmap": [
"database"
],
"psr-4": {
"App\\": "app/"
},
"files": ["app/helpers.php"]
},
"autoload-dev": {
"psr-4": {
"Tests\\": "tests/"
}
},
"scripts": {
"post-root-package-install": [
"php -r \"file_exists('.env') || copy('.env.example', '.env');\""
],
"post-create-project-cmd": [
"php artisan key:generate"
],
"post-install-cmd": [
"Illuminate\\Foundation\\ComposerScripts::postInstall",
"php artisan optimize"
],
"post-update-cmd": [
"Illuminate\\Foundation\\ComposerScripts::postUpdate",
"php artisan optimize"
]
},
"config": {
"preferred-install": "dist",
"sort-packages": true,
"optimize-autoloader": true
}
}
'articles_e'是当前未使用的表格。我删除并重新创建了'articles_e'表,但这并没有解决。 此外,由于我首先创建了迁移并创建了db,因此我直接在mysql中多次更改了表结构。我不知道这是不是原因。
感谢您的帮助。感谢。