Проблема миграции Laravel: база данных не существуетPhp

Кемеровские программисты php общаются здесь
Ответить
Anonymous
 Проблема миграции Laravel: база данных не существует

Сообщение Anonymous »


I've been scratching my head for maybe the last hour trying to figure out what's going on.

I deleted my database.sql file since I wanted a new one from scratch. I've done this dozens of times, but upon running php artisan migrate:fresh it returned the following error:

Database file at path [{..}/database/database.sqlite] does not exist. Ensure this is an absolute path to the database. (Connection: sqlite, SQL: PRAGMA foreign_keys = ON;) at vendor/laravel/framework/src/Illuminate/Database/Connection.php:829 825▕ $this->getName(), $query, $this->prepareBindings($bindings), $e 826▕ ); 827▕ } 828▕ ➜ 829▕ throw new QueryException( 830▕ $this->getName(), $query, $this->prepareBindings($bindings), $e 831▕ ); 832▕ } 833▕ } 1 [internal]:0 Illuminate\Foundation\Application::Illuminate\Foundation\{closure}(Object(App\Providers\AppServiceProvider)) +17 vendor frames 19 app/Providers/AppServiceProvider.php:24 Illuminate\Support\Facades\Facade::__callStatic("table") This has always created the database itself, why is it not now?

I created the database.sqlite in the original directory manually, and it came out with this error instead:

SQLSTATE[HY000]: General error: 1 no such table: kingdoms (Connection: sqlite, SQL: select count(*) as aggregate from "kingdoms") at vendor/laravel/framework/src/Illuminate/Database/Connection.php:829 825▕ $this->getName(), $query, $this->prepareBindings($bindings), $e 826▕ ); 827▕ } 828▕ ➜ 829▕ throw new QueryException( 830▕ $this->getName(), $query, $this->prepareBindings($bindings), $e 831▕ ); 832▕ } 833▕ } I thought this might be an issue with the create_kingdoms_table.php migration, so I removed it to see, and somehow, the error is still the same even with the migration gone, even after clearing cache.


Источник: https://stackoverflow.com/questions/780 ... -not-exist
Ответить

Быстрый ответ

Изменение регистра текста: 
Смайлики
:) :( :oops: :roll: :wink: :muza: :clever: :sorry: :angel: :read: *x)
Ещё смайлики…
   
К этому ответу прикреплено по крайней мере одно вложение.

Если вы не хотите добавлять вложения, оставьте поля пустыми.

Максимально разрешённый размер вложения: 15 МБ.

Вернуться в «Php»