2017 © Pedro Peláez
 

laravel-package laravel-sqlite-migrations

A trait to translate Laravel migrations into SQLite safe migrations.

image

jjclane/laravel-sqlite-migrations

A trait to translate Laravel migrations into SQLite safe migrations.

  • Monday, April 9, 2018
  • by JJCLane
  • Repository
  • 1 Watchers
  • 3 Stars
  • 27 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 4 Versions
  • 93 % Grown

The README.md

Laravel SQLite Migrations

A trait to translate Laravel migrations into SQLite safe migrations. This avoids the Cannot add a NOT NULL column with default value NULL issue that you receive when trying to add a non-nullable column to an existing table in a migration by initially adding the column as nullable and then modifying the column in a separate migration. It also maps Laravel datatypes that aren't supported in SQLite to avoid this., (*1)

Installation

composer require jjclane/laravel-sqlite-migrations --dev, (*2)

How to use

<?php

use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
use JJCLane\SQLiteMigration\TransformMigration;

class AddColumnToTable extends Migration
{
    use TransformMigration;

    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        $this->table('table', function (Blueprint $table) {
            // Normal migrations
            $table->decimal('my_col', 10, 1)->unsigned()->after('my_other_col');
        });

        // or if you prefer to be more explicit
        $this->transformMigration('table', function (Blueprint $table) {
            // Normal migrations
            $table->decimal('my_col', 10, 1)->unsigned()->after('my_other_col');
        });
    }
}

The Versions

09/04 2018

dev-master

9999999-dev

A trait to translate Laravel migrations into SQLite safe migrations.

  Sources   Download

MIT

The Requires

 

by Jordan Lane

09/04 2018

0.1.2

0.1.2.0

A trait to translate Laravel migrations into SQLite safe migrations.

  Sources   Download

MIT

The Requires

 

by Jordan Lane

09/04 2018

0.1.1

0.1.1.0

A trait to translate Laravel migrations into SQLite safe migrations.

  Sources   Download

MIT

The Requires

 

by Jordan Lane

09/04 2018

0.1.0

0.1.0.0

A trait to translate Laravel migrations into SQLite safe migrations.

  Sources   Download

MIT

The Requires

 

by Jordan Lane