0

I like use sqlite for CRUD with Laravel 4.2 & artisan.

php artisan generate:migration create_XXX_table 

Edit app/database/migrations/YYYY_MM_DD_HHMMSS_create_XXX_table.php

<?php
use Illuminate\Database\Schema\Blueprint; 
use Illuminate\Database\Migrations\Migration;

class CreateKeysTable extends Migration {

/**
 * Run the migrations.
 *
 * @return void
 */
public function up()
{
    Schema::table('keys', function(Blueprint $table)
    {
        $table->increments('id');
        $table->text('key_pub');
        $table->text('key_private');

        $table->timestamps();
    });
}

/**
 * Reverse the migrations.
 *
 * @return void
 */
public function down()
{
    Schema::table('keys', function(Blueprint $table)
    {
        //
    });
}

}

of course, config for local and production enviroment are sqlite driver, and for use 'database' => storage_path().'/MYDATABASE.sqlite', MYDATABASE.sqlite it's only a file create with touch.

Also try, with not file MYDATABASE.sqlite but problem it's other.

[InvalidArgumentException]  
   Database does not exist. 

On various articles on internet, show this method. Create a empty file, on rute.

But not work any.

abkrim
  • 3,512
  • 7
  • 43
  • 69

0 Answers0