laravel-code-generator icon indicating copy to clipboard operation
laravel-code-generator copied to clipboard

Sometimes Doctrine\DBAL\Driver\PDOException::("SQLSTATE[HY000] [1049] Unknown database 'laravel'")

Open renepardon opened this issue 5 years ago • 0 comments

Environment:

  • Laravel-Code-Generator Version: 2.4
  • Laravel Version: 6.2

Description:

Sometimes when executing php artisan create:api-scaffold, I receive the error:

Doctrine\DBAL\Driver\PDOException::("SQLSTATE[HY000] [1049] Unknown database 'laravel'")

Of course the .env file contains real database credentials and a name other than "laravel". I don't even know why the codegen tries to access the database because I don't use the --table-exists flag.

Steps/Commands To Reproduce:

Fresh laravel installation, fresh codegen installation - go for it :)

php artisan create:api-scaffold \
--with-form-request \
--with-auth \
--with-soft-delete \
--with-migration \
--translation-for=de,en \
--language-filename=media_category_i18n \
--table-name=media_category_i18ns \
--fields=id,media_category_id,name \
MediaCategoryI18n

Content Of The Resource-File:

private project!

renepardon avatar Dec 16 '19 13:12 renepardon