Kalo waktu ketikan perintah "php artisan migrate:fresh --seed" mucul pesan error

PS C:\xampp\htdocs\laboratorium-app> php artisan migrate
Migrating: 2021_08_09_122324_add_fk_to_items_table

   Illuminate\Database\QueryException

  SQLSTATE[42S02]: Base table or view not found: 1146 Table 'laboratorium_app.items' doesn't exist (SQL: alter table `items` add `unit_id` bigint unsigned null, add `place_id` bigint unsigned null, add `comment_id` bigint unsigned null, add `log_id` bigint unsigned null)

  at C:\xampp\htdocs\laboratorium-app\vendor\laravel\framework\src\Illuminate\Database\Connection.php:692
    688▕         // If an exception occurs when attempting to run a query, we'll format the error
    689▕         // message to include the bindings with SQL, which will make this exception a
    690▕         // lot more helpful to the developer instead of just the database's errors.
    691▕         catch (Exception $e) {
   692▕             throw new QueryException(
    693▕                 $query, $this->prepareBindings($bindings), $e
    694▕             );
    695▕         }
    696▕     }

   A table was not found: You might have forgotten to run your migrations. You can run your migrations using `php artisan migrate`.
    https://laravel.com/docs/master/migrations#running-migrations

  1   C:\xampp\htdocs\laboratorium-app\vendor\laravel\framework\src\Illuminate\Database\Connection.php:485
      PDOException::("SQLSTATE[42S02]: Base table or view not found: 1146 Table 'laboratorium_app.items' doesn't exist")

  2   C:\xampp\htdocs\laboratorium-app\vendor\laravel\framework\src\Illuminate\Database\Connection.php:485
      PDOStatement::execute()
avatar 20_sindiayuanggraeni
@20_sindiayuanggraeni

5 Kontribusi 0 Poin

Dipost 3 tahun yang lalu

Tanggapan

Pastikan table items sudah ada pada database, atau urutan file migration untuk create tabel itemsnya ada diawal..

Belum ada Jawaban. Jadi yang pertama Jawaban

Login untuk ikut Jawaban