In order to answer this part of the OP's question:
"Any ideas how I can get artisan migrate to create an sqlite db in laravel 5?"
In some cases where deployment and migrations need to be scripted I use a Service Provider to check the Sqlite DB exists and if not create it.
Here are the steps:
1) Create a Provider and save it to app/Providers/SqliteServiceProvider.php
<?php
namespace App\Providers;
use Illuminate\Support\ServiceProvider;
class SqliteServiceProvider extends ServiceProvider
{
/**
* Bootstrap the application services.
*
* @return void
*/
public function boot()
{
$databaseFile = config('database.connections.sqlite.database');
if (!file_exists($databaseFile)) {
info('Make Sqlite File "' . $databaseFile . '"');
file_put_contents($databaseFile, '');
}
}
}
2) Register the provider in config/app.php. For example in a fresh L5.8 install the SqliteServiceProvider would be placed under the RouteServiceProvider like so:
'providers' => [
//...
/*
* Application Service Providers...
*/
App\Providers\AppServiceProvider::class,
App\Providers\AuthServiceProvider::class,
// App\Providers\BroadcastServiceProvider::class,
App\Providers\EventServiceProvider::class,
App\Providers\RouteServiceProvider::class,
App\Providers\SqliteServiceProvider::class, // <--- HERE
],
3) Add/replace the following to the 'connections' element of config/database.php
'sqlite' => [
'driver' => 'sqlite',
'database' => env('DB_SQLITE_FILEPATH', database_path('database.sqlite')),
'prefix' => '',
'foreign_key_constraints' => env('DB_FOREIGN_KEYS', true),
],
4) In my .env file I add this:
DB_SQLITE_FILEPATH=/full/path/to/mysqlitefilename.sqlite
...but if you prefer you can skip this step and the DB will be created as database/database.sqlite.
5) Run your migration as usual and the sqlite file should be created then populated.
artisan migrate:statusshow?