未找到列:1054“字段列表”中未知列“徽标”

Illuminate\Database\QueryException thrown with message "SQLSTATE[42S22]: Column not found: 1054 Unknown column 'logo' in 'field list' (SQL: update `basic_settings` set `footer_text` = We Invest your money property projects and we earn you 40% monthly. Welcome onboard let's join hands together., `copy_text` = Copyright © Pro Invest SA 2017 - 2020 All Right Reserved., `updated_at` = 2020-08-03 23:55:19, `logo` = /tmp/phpfptGnR where `id` = 1)"

Stacktrace:

#64 Illuminate\Database\QueryException in /home/proinve2/public_html/core/vendor/laravel/framework/src/Illuminate/Database/Connection.php:664

#63 PDOException in /home/proinve2/public_html/core/vendor/laravel/framework/src/Illuminate/Database/Connection.php:479

#62 PDO:prepare in /home/proinve2/public_html/core/vendor/laravel/framework/src/Illuminate/Database/Connection.php:479

#61 Illuminate\Database\Connection:Illuminate\Database\{closure} in /home/proinve2/public_html/core/vendor/laravel/framework/src/Illuminate/Database/Connection.php:657

#60 Illuminate\Database\Connection:runQueryCallback in /home/proinve2/public_html/core/vendor/laravel/framework/src/Illuminate/Database/Connection.php:624

#59 Illuminate\Database\Connection:run in /home/proinve2/public_html/core/vendor/laravel/framework/src/Illuminate/Database/Connection.php:490

#58 Illuminate\Database\Connection:affectingStatement in /home/proinve2/public_html/core/vendor/laravel/framework/src/Illuminate/Database/Connection.php:423



ABOUTYOU
浏览 104回答 1
1回答

慕斯709654

basic_settings使用命令将新列添加到表中php artisan make:migration add_logo_field_to_basic_settings_table。创建迁移后,进行如下更改。<?phpuse Illuminate\Database\Migrations\Migration;use Illuminate\Database\Schema\Blueprint;use Illuminate\Support\Facades\Schema;class AddLogoFieldToBasicSettingsTable extends Migration{&nbsp;&nbsp; &nbsp; public function up()&nbsp; &nbsp; {&nbsp; &nbsp; &nbsp; &nbsp; Schema::table('basic_settings', function (Blueprint $table) {&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $table->string('logo');&nbsp; &nbsp; &nbsp; &nbsp; });&nbsp; &nbsp; }&nbsp; &nbsp;&nbsp; &nbsp; public function down()&nbsp; &nbsp; {&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Schema::table('basic_settings', function (Blueprint $table) {&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $table->dropColumn(['logo']);&nbsp; &nbsp; &nbsp; &nbsp; });&nbsp; &nbsp; }}&nbsp;现在您可以迁移并创建或更新logo列。迁移: php artisan migrate
打开App,查看更多内容
随时随地看视频慕课网APP