2017 © Pedro Peláez
 

library fast-migrate

Migrate even faster!

image

lawrence/fast-migrate

Migrate even faster!

  • Wednesday, November 4, 2015
  • by lwakefield
  • Repository
  • 1 Watchers
  • 3 Stars
  • 25 Installations
  • PHP
  • 2 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 4 Versions
  • 0 % Grown

The README.md

FastMigrate

Migrate even faster with FastMigrate! FastMigrate is essentially a wrapper around Laravels migration class. FastMigrate aims to make creating tables easier and faster., (*1)

FastMigrate requires Laravel >= 5.0, (*2)

Installation

To install, simply composer require lawrence/fast-migrate:dev-master, (*3)

Example

An example of FastMigrate in use is shown below., (*4)

<?php

use FastMigrate\FastMigrator;
use Schema;

class ExampleMigration extends FastMigrator
{

    public function up()
    {
        $I = $this;
        $I->wantATable('users')
            ->withStrings('username', 'password');

        $I->wantATable('roles')
            ->withStrings('description');

        $I->wantATable('posts')
            ->withStrings('title', 'content')
            ->withIntegers('score');

        $I->want('users')
            ->toHaveMany('posts');
        $I->want('users')
            ->toHaveOne('roles');

        $I->amReadyForMigration();
    }

    public function down()
    {
        Schema::dropIfExists('users');
        Schema::dropIfExists('posts');
        Schema::dropIfExists('roles');
    }
}

Running the above migration will generate three tables as follows:, (*5)

- users:
    - id
    - created_at
    - updated_at
    - username
    - password
    - role_id

- roles:
    - id
    - created_at
    - updated_at
    - description

- posts:
    - id
    - created_at
    - updated_at
    - title
    - content
    - score
    - user_id

The Versions

04/11 2015

dev-master

9999999-dev

Migrate even faster!

  Sources   Download

MIT

The Requires

 

The Development Requires

by Lawrence Wakefield

database laravel sql framework migration

04/11 2015

v1.2

1.2.0.0

Migrate even faster!

  Sources   Download

MIT

The Requires

 

The Development Requires

by Lawrence Wakefield

database laravel sql framework migration

11/09 2015

v1.1

1.1.0.0

Migrate even faster!

  Sources   Download

MIT

The Requires

 

The Development Requires

by Lawrence Wakefield

database laravel sql framework migration

03/09 2015

v1.0

1.0.0.0

Migrate even faster!

  Sources   Download

MIT

The Requires

 

The Development Requires

by Lawrence Wakefield

database laravel sql framework migration