I'm have my APP_ENV set to production as I'm developing an API and want responses to match what I'll see when released
And APP_ENV=production helps with that how?
I've been developing tests in my "production" mysql database(app is unreleased) and realize I should have a separate test database so setting one up now. I'm following the Laracast on how to set up a test sqlite database, but it's not working I'm getting the error:
eddie@production:~/projects/production2.0$ php artisan migrate --database=sqlite_testing
**************************************
* Application In Production! *
**************************************
Do you really wish to run this command? (yes/no) [no]:
> yes
Illuminate\Database\QueryException
Database (production) does not exist. (SQL: PRAGMA foreign_keys = ON;)
at vendor/laravel/framework/src/Illuminate/Database/Connection.php:703
699▕ // If an exception occurs when attempting to run a query, we'll format the error
700▕ // message to include the bindings with SQL, which will make this exception a
701▕ // lot more helpful to the developer instead of just the database's errors.
702▕ catch (Exception $e) {
➜ 703▕ throw new QueryException(
704▕ $query, $this->prepareBindings($bindings), $e
705▕ );
706▕ }
707▕ }
+35 vendor frames
36 artisan:37
Illuminate\Foundation\Console\Kernel::handle()
eddie@production:~/projects/production2.0$
Note: the name of my production database is production. I have my APP_ENV set to production as I'm developing an API and want responses to match what I'll see when released...
I touched a file for the DB and permissions look OK:
eddie@production:~/projects/production2.0$ ls -l database/testing.sqlite
-rw-rw-r-- 1 eddie eddie 0 Apr 19 06:42 database/testing.sqlite
My config/database.php is as follows:
'sqlite_testing' => [
'driver' => 'sqlite',
'url' => env('DATABASE_URL'),
'database' => env('DB_DATABASE', database_path('testing.sqlite')),
'prefix' => '',
'foreign_key_constraints' => env('DB_FOREIGN_KEYS', true),
],
Please note I'm running Laravel 8.6.4, and the video is for 5.5, maybe something changed? Any pointers would be greatly appreciated!
Please or to participate in this conversation.