pbootcms网站模板|日韩1区2区|织梦模板||网站源码|日韩1区2区|jquery建站特效-html5模板网

  • <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="ftpe05r" 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="0e55rfi" 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="xm5cxtz" 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>
                            主站蜘蛛池模板: 气动调节阀,电动调节阀,自力式压力调节阀,切断阀「厂家」-浙江利沃夫自控阀门 | 模具ERP_模具管理系统_模具mes_模具进度管理_东莞市精纬软件有限公司 | 博博会2021_中国博物馆及相关产品与技术博览会【博博会】 | 玻璃瓶厂家_酱菜瓶厂家_饮料瓶厂家_酒瓶厂家_玻璃杯厂家_徐州东明玻璃制品有限公司 | 基业箱_环网柜_配电柜厂家_开关柜厂家_开关断路器-东莞基业电气设备有限公司 | 杭州双螺杆挤出机-百科| 定制/定做衬衫厂家/公司-衬衫订做/订制价格/费用-北京圣达信 | 哲力实业_专注汽车涂料汽车漆研发生产_汽车漆|修补油漆品牌厂家 长沙一级消防工程公司_智能化弱电_机电安装_亮化工程专业施工承包_湖南公共安全工程有限公司 | 旗杆生产厂家_不锈钢锥形旗杆价格_铝合金电动旗杆-上海锥升金属科技有限公司 | 板式换网器_柱式换网器_自动换网器-郑州海科熔体泵有限公司 | 真空上料机(一种真空输送机)-百科| 无线对讲-无线对讲系统解决方案-重庆畅博通信 | 创富网-B2B网站|供求信息网|b2b平台|专业电子商务网站 | 电缆桥架生产厂家_槽式/梯式_热镀锌线槽_广东东莞雷正电气 | 旋片真空泵_真空泵_水环真空泵_真空机组-深圳恒才机电设备有限公司 | 短信群发平台_群发短信软件_短信营销-讯鸽科技 | 活性氧化铝球|氧化铝干燥剂|分子筛干燥剂|氢氧化铝粉-淄博同心材料有限公司 | 柴油发电机组_柴油发电机_发电机组价格-江苏凯晨电力设备有限公司 | 包塑软管|金属软管|包塑金属软管-闵彬管业 | 深圳展厅设计_企业展馆设计_展厅设计公司_数字展厅设计_深圳百艺堂 | 小型UV打印机-UV平板打印机-大型uv打印机-UV打印机源头厂家 |松普集团 | COD分析仪|氨氮分析仪|总磷分析仪|总氮分析仪-圣湖Greatlake | 全自动实验室洗瓶机,移液管|培养皿|进样瓶清洗机,清洗剂-广州摩特伟希尔机械设备有限责任公司 | 北京软件开发_软件开发公司_北京软件公司-北京宜天信达软件开发公司 | 粉末包装机,拆包机厂家,价格-上海强牛包装机械设备有限公司 | 杭州画室_十大画室_白墙画室_杭州美术培训_国美附中培训_附中考前培训_升学率高的画室_美术中考集训美术高考集训基地 | 塑料撕碎机_编织袋撕碎机_废纸撕碎机_生活垃圾撕碎机_废铁破碎机_河南鑫世昌机械制造有限公司 | 纯化水设备-EDI-制药-实验室-二级反渗透-高纯水|超纯水设备 | 建筑资质代办-建筑资质转让找上海国信启航 | 电镀整流器_微弧氧化电源_高频电解电源_微弧氧化设备厂家_深圳开瑞节能 | 全自动包装秤_全自动上袋机_全自动套袋机_高位码垛机_全自动包装码垛系统生产线-三维汉界机器(山东)股份有限公司 | 煤矿支护网片_矿用勾花菱形网_缝管式_管缝式锚杆-邯郸市永年区志涛工矿配件有限公司 | 小型数控车床-数控车床厂家-双头数控车床 | 一氧化氮泄露报警器,二甲苯浓度超标报警器-郑州汇瑞埔电子技术有限公司 | 塑料异型材_PVC异型材_封边条生产厂家_PC灯罩_防撞扶手_医院扶手价格_东莞市怡美塑胶制品有限公司 | 酒糟烘干机-豆渣烘干机-薯渣烘干机-糟渣烘干设备厂家-焦作市真节能环保设备科技有限公司 | 走心机厂家,数控走心机-台州博城智能科技有限公司 | 3d打印服务,3d打印汽车,三维扫描,硅胶复模,手板,快速模具,深圳市精速三维打印科技有限公司 | 全自动面膜机_面膜折叠机价格_面膜灌装机定制_高速折棉机厂家-深圳市益豪科技有限公司 | 上海单片机培训|重庆曙海培训分支机构—CortexM3+uC/OS培训班,北京linux培训,Windows驱动开发培训|上海IC版图设计,西安linux培训,北京汽车电子EMC培训,ARM培训,MTK培训,Android培训 | 喷播机厂家_二手喷播机租赁_水泥浆洒布机-河南青山绿水机电设备有限公司 |