dev-master
9999999-devWrite your phinx migrations as sweet as laravel eloquent.
MIT
The Requires
database migrations eloquent db phinx database migrations eloquent migrations
Write your phinx migrations as sweet as laravel eloquent.
This is a library that try to make phinx migrations more readable, just like Laravel Eloquent., (*1)
TODO: Continue., (*2)
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)
<?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'); } }
This package is under development and not working yet., (*5)
Write your phinx migrations as sweet as laravel eloquent.
MIT
database migrations eloquent db phinx database migrations eloquent migrations