2017 © Pedro Peláez
 

library cli

Console wrapper for Baleen Migrations

image

baleen/cli

Console wrapper for Baleen Migrations

  • Monday, December 7, 2015
  • by gabriel.somoza
  • Repository
  • 4 Watchers
  • 7 Stars
  • 228 Installations
  • PHP
  • 2 Dependents
  • 0 Suggesters
  • 1 Forks
  • 0 Open issues
  • 12 Versions
  • 1 % Grown

The README.md

Baleen CLI

Build Status Code Coverage Scrutinizer Code Quality Packagist, (*1)

Author License, (*2)

Generic, customisable command-line wrapper for Baleen Migrations., (*3)

Installation

With Composer:, (*4)

composer install baleen/cli

Baleen CLI is quite opinionated in its defaults, so it doesn't need extra configuration to run. So if you'd like to just test-drive the project, you can now jump straight to the "usage" section., (*5)

But you can customize almost anything through a configuration file. To create a configuration file, run the following:, (*6)

./vendor/bin/baleen init

This will generate two files in your working directory:, (*7)

  • .baleen.yml: the configuration file.
  • .baleen_versions: a simple file to keep track of which versions have been migrated. This can later be replaced with a database table. You may want to ignore this file in your VCS system (e.g. using Git's .gitignore file).

The .baleen_versions file will be created for you automatically if you use the default configuration values. You don't need to run baleen init in order for the file to be created., (*8)

If you don't want to type ./vendor/bin/baleen to run baleen commands then you can alternatively use Composer as a shortcut. Just edit your project's composer.json file to add the following:, (*9)

json { "scripts": { "baleen": "vendor/bin/baleen --ansi" } }, (*10)

Now you can run Baleen CLI easily by just typing composer baleen!, (*11)

Usage

To see some help and a list of available commands, simply execute:, (*12)

./vendor/bin/baleen

For more help on a specific command simply run ./vendor/bin/baleen help {command}, replacing {command} with the name of an available command., (*13)

Creating Migrations

Migrations are stored by default under the ./migrations directory, which will be automatically created every time your run a commend if it doesn't exist., (*14)

You can customise which directory to use for migrations, as well as the namespace for migration classes by editing the .baleen.yml config file., (*15)

To easily create a new Migration file run the following command:, (*16)

./vendor/bin/baleen migrations:create

Running Migrations

Running migrations is as easy as executing:, (*17)

./vendor/bin/baleen migrate

By default it will migrate up to the latest available version., (*18)

If you'd like to see a log instead of the progress-bar then just add the --no-progress option to the migrate command above., (*19)

Documentation

Documentation can be found either in the ./docs folder or compiled and online at Read The Docs: http://baleen-cli.readthedocs.org/en/latest/, (*20)

License

Licensed under MIT - for more details please refer to the LICENSE file at the root directory., (*21)

The Versions