久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

  • <small id='3EV4t'></small><noframes id='3EV4t'>

      <bdo id='3EV4t'></bdo><ul id='3EV4t'></ul>
    <tfoot id='3EV4t'></tfoot>
      <legend id='3EV4t'><style id='3EV4t'><dir id='3EV4t'><q id='3EV4t'></q></dir></style></legend>
      <i id='3EV4t'><tr id='3EV4t'><dt id='3EV4t'><q id='3EV4t'><span id='3EV4t'><b id='3EV4t'><form id='3EV4t'><ins id='3EV4t'></ins><ul id='3EV4t'></ul><sub id='3EV4t'></sub></form><legend id='3EV4t'></legend><bdo id='3EV4t'><pre id='3EV4t'><center id='3EV4t'></center></pre></bdo></b><th id='3EV4t'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='3EV4t'><tfoot id='3EV4t'></tfoot><dl id='3EV4t'><fieldset id='3EV4t'></fieldset></dl></div>

        未定義的表:7 錯誤:關系“費用";不存在

        Undefined table: 7 ERROR: relation quot;expensesquot; does not exist(未定義的表:7 錯誤:關系“費用;不存在)
          <legend id='0mjFN'><style id='0mjFN'><dir id='0mjFN'><q id='0mjFN'></q></dir></style></legend>
        • <i id='0mjFN'><tr id='0mjFN'><dt id='0mjFN'><q id='0mjFN'><span id='0mjFN'><b id='0mjFN'><form id='0mjFN'><ins id='0mjFN'></ins><ul id='0mjFN'></ul><sub id='0mjFN'></sub></form><legend id='0mjFN'></legend><bdo id='0mjFN'><pre id='0mjFN'><center id='0mjFN'></center></pre></bdo></b><th id='0mjFN'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='0mjFN'><tfoot id='0mjFN'></tfoot><dl id='0mjFN'><fieldset id='0mjFN'></fieldset></dl></div>

              <tbody id='0mjFN'></tbody>

            <small id='0mjFN'></small><noframes id='0mjFN'>

          1. <tfoot id='0mjFN'></tfoot>
              <bdo id='0mjFN'></bdo><ul id='0mjFN'></ul>

                  本文介紹了未定義的表:7 錯誤:關系“費用";不存在的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

                  問題描述

                  因為我會說西班牙語,所以我用西班牙語寫了收入和支出的控制器和模型;而其余的都是英文的..我手動重命名和更改了路由、控制器、遷移甚至模型.當我運行 php artisan migrate:reset 這是我的錯誤.

                  Since i am a spanish speaker, i wrote the controllers and models of income and expense in spanish; while all the rest were on english.. I renamed and changed manually Routes, Controllers, Migrations and even Models. And when i run php artisan migrate:reset this is my error.

                  未定義表:7 錯誤:關系費用"不存在(SQL:更改表費用"刪除列location_id")**

                  Undefined table: 7 ERROR: relation "expenses" does not exist (SQL: alter table "expenses" drop column "location_id")**

                  我使用 psgql 和 laravel 5.3

                  I use psgql and laravel 5.3

                  這是我的代碼:

                      <?php
                  
                      namespace App;
                  
                      use IlluminateDatabaseEloquentModel;
                  
                      class Expense extends Model
                      {
                  
                          protected $fillable = ['id', 'description', 'quantity'];
                  
                  
                          public function locations()
                          {
                  
                              return $this->hasMany('AppLocation');
                  
                          }
                          public function icons()
                          {
                  
                              return $this->hasMany('AppIcon');
                          }
                          public function types()
                          {
                  
                              return $this->hasMany('AppType');
                          }
                          public function stores()
                          {
                  
                              return $this->hasMany('AppStore');
                          }
                  
                      }
                  

                  遷移:

                      <?php
                  
                  use IlluminateSupportFacadesSchema;
                  use IlluminateDatabaseSchemaBlueprint;
                  use IlluminateDatabaseMigrationsMigration;
                  
                  class CreateExpensesTable extends Migration
                  {
                      /**
                       * Run the migrations.
                       *
                       * @return void
                       */
                      public function up()
                      {
                          Schema::create('expenses', function (Blueprint $table) {
                              $table->increments('id');
                              $table->float('quantity');
                              $table->string('description');
                              $table->integer('location_id')->unsigned();
                              $table->integer('icon_id')->unsigned();
                              $table->integer('type_id')->unsigned();
                              $table->integer('store_id')->unsigned();
                              $table->timestamps();
                          });
                      }
                  
                      /**
                       * Reverse the migrations.
                       *
                       * @return void
                       */
                      public function down()
                      {
                          Schema::dropIfExists('expenses');
                      }
                  }
                  

                  位置遷移:

                  <?php
                  
                  use IlluminateSupportFacadesSchema;
                  use IlluminateDatabaseSchemaBlueprint;
                  use IlluminateDatabaseMigrationsMigration;
                  
                  class CreateLocationsTable extends Migration
                  {
                      /**
                       * Run the migrations.
                       *
                       * @return void
                       */
                      public function up()
                      {
                          Schema::create('locations', function (Blueprint $table) {
                              $table->increments('id');
                              $table->string('address');
                              $table->float('lat');
                              $table->float('long');
                              $table->integer('store_id')->unsigned();
                              $table->timestamps();
                  
                              $table->foreign('store_id')->references('id')->on('stores')->onDelete('cascade');
                          });
                  
                          Schema::table('expenses', function (Blueprint $table) {
                              $table->foreign('location_id')->references('id')->on('locations')->onDelete('cascade');
                          });
                      }
                  
                      /**
                       * Reverse the migrations.
                       *
                       * @return void
                       */
                      public function down()
                      {
                          Schema::table('expenses', function (Blueprint $table) {
                              $table->dropColumn('location_id');
                          });
                  
                          Schema::dropIfExists('locations');
                      }
                  }
                  

                  型號:

                  <?php
                  
                  namespace App;
                  
                  use IlluminateDatabaseEloquentModel;
                  
                  class Location extends Model
                  {
                  
                      protected $fillable = ['id', 'address', 'lat', 'long'];
                  
                  
                      public function expenses()
                      {
                  
                          return $this->belongsTo('AppExpense');
                      }
                  
                      public function stores()
                      {
                  
                          return $this->hasOne('AppStore');
                      }
                  }
                  

                  希望你能幫助我.

                  推薦答案

                  當它說

                  relation "expenses" does not exist
                  

                  通常發生在您的費用表必須在 migration:reset 回滾 CreateLocationsTable 之前被刪除時.

                  It usually happens when your expenses table must have been dropped before migration:reset rolled back CreateLocationsTable.

                  檢查遷移的執行順序.

                  當您嘗試重置時,現在要修復它,請打開您的數據庫,手動刪除所有表并再次執行 migrate.

                  As you were trying to reset, to fix it now, open your database, drop all tables manually and execute migrate again.

                  這篇關于未定義的表:7 錯誤:關系“費用";不存在的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!

                  【網站聲明】本站部分內容來源于互聯網,旨在幫助大家更快的解決問題,如果有圖片或者內容侵犯了您的權益,請聯系我們刪除處理,感謝您的支持!

                  相關文檔推薦

                  MySQLi prepared statement amp; foreach loop(MySQLi準備好的語句amp;foreach 循環)
                  Is mysqli_insert_id() gets record from whole server or from same user?(mysqli_insert_id() 是從整個服務器還是從同一用戶獲取記錄?)
                  PHP MySQLi doesn#39;t recognize login info(PHP MySQLi 無法識別登錄信息)
                  mysqli_select_db() expects exactly 2 parameters(mysqli_select_db() 需要 2 個參數)
                  Php mysql pdo query: fill up variable with query result(Php mysql pdo 查詢:用查詢結果填充變量)
                  MySQLI 28000/1045 Access denied for user #39;root#39;@#39;localhost#39;(MySQLI 28000/1045 用戶“root@“localhost的訪問被拒絕)

                  <tfoot id='cXPbp'></tfoot>
                • <i id='cXPbp'><tr id='cXPbp'><dt id='cXPbp'><q id='cXPbp'><span id='cXPbp'><b id='cXPbp'><form id='cXPbp'><ins id='cXPbp'></ins><ul id='cXPbp'></ul><sub id='cXPbp'></sub></form><legend id='cXPbp'></legend><bdo id='cXPbp'><pre id='cXPbp'><center id='cXPbp'></center></pre></bdo></b><th id='cXPbp'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='cXPbp'><tfoot id='cXPbp'></tfoot><dl id='cXPbp'><fieldset id='cXPbp'></fieldset></dl></div>

                    <small id='cXPbp'></small><noframes id='cXPbp'>

                      <bdo id='cXPbp'></bdo><ul id='cXPbp'></ul>

                        • <legend id='cXPbp'><style id='cXPbp'><dir id='cXPbp'><q id='cXPbp'></q></dir></style></legend>
                            <tbody id='cXPbp'></tbody>
                            主站蜘蛛池模板: 亚洲成人免费电影 | 成人一区在线观看 | 激情的网站 | 毛片av免费看 | 国产玖玖| 女同久久另类99精品国产 | 亚洲 欧美 另类 综合 偷拍 | 日韩视频一区二区三区 | 午夜影院黄 | 日韩精品一区二区三区中文字幕 | 毛片一级电影 | 精品视频在线一区 | 国产精品久久777777 | 日韩一二区在线 | 日韩在线欧美 | 日韩欧美手机在线 | 欧美极品视频 | 亚洲一区二区三区高清 | 亚洲三区在线播放 | 国产999在线观看 | 久久天堂 | 国产精品呻吟久久av凹凸 | 久草网址 | www.国产精品 | 中国三级黄色录像 | 日韩在线中文字幕 | 三区四区在线观看 | 国产一区二区三区四区五区3d | 国产自产c区 | 你懂的在线视频播放 | 国产一级片91 | 91久久久久久久久久久 | 欧美成人在线网站 | 午夜一区二区三区在线观看 | 日韩毛片播放 | 久久久精品网站 | 精品婷婷 | 99久久精品免费看国产四区 | 亚洲综合色丁香婷婷六月图片 | 午夜精品久久久久久久久久久久久 | 精品美女久久久久久免费 |