2017 © Pedro PelĂĄez
 

library phinx-sugar

Write your phinx migrations as sweet as laravel eloquent.

image

anyeloamt/phinx-sugar

Write your phinx migrations as sweet as laravel eloquent.

  • Friday, July 25, 2014
  • by anyeloamt
  • Repository
  • 0 Watchers
  • 0 Stars
  • 2 Installations
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 1 Versions
  • 0 % Grown

The README.md

phinx-sugar

This is a library that try to make phinx migrations more readable, just like Laravel Eloquent., (*1)

TODO: Continue., (*2)

Instalation.

You can install phinx-sugar via composer. Just add it add dependency to the composer.json file., (*3)

"require": {
    "anyeloamt/phing-sugar": "dev-master"
}

Then execute composer update., (*4)

phinx-sugar migration example.

<?php namespace PhinxSugar;

use PhinxSugar\Db\Schema;
use PhinxSugar\Migration\Migration;

/**
 * Example migration class
 *
 */
class CreatePostsTable extends Migration
{

    public function up(Schema $schema)
    {
        $table = $schema->create('posts');

        // $table->primaryKey('post_id');

        $table->string('title')
            ->lenght(100)
            ->default('Test title')
            ->nullable(false)
            ->unique();

        $table->text('content');

        $table->foreign('user_id')
            ->references('id')
            ->on('users')
            ->onDelete('cascade')
            ->onUpdate('cascade');

        $table->index(array('title'));

        $table->timestamps();
    }

    public function down(Schema $schema)
    {
        $schema->drop('posts');
    }
}

Important

This package is under development and not working yet., (*5)

The Versions

25/07 2014

dev-master

9999999-dev

Write your phinx migrations as sweet as laravel eloquent.

  Sources   Download

MIT

The Requires

 

database migrations eloquent db phinx database migrations eloquent migrations