User’s Guide

Installation

Install with Composer:

composer install baleen/cli

Configuration

Then run the following command on the root directory of the project you want to migrate:

./vendor/bin/baleen init

This will create a configuration file called .baleen.yml and a storage file at .baleen_versions. You should put the config file under version control, but not the storage file.

Why a storage file instead of a database table? Baleen is database-agnostic. That’s where YOU come in: you can customize Baleen CLI to use any other type of storage you can imagine. A local file is just the default we decided to ship with.

Usage

To see usage information and a list of available commands run ./vendor/bin/baleen without any arguments.

Creating Migrations

Creating a migration is very easy, just run:

./vendor/bin/baleen create SomeOptionalTitle

A new migration file will be created inside your configured migrations folder.

Note that Baleen CLI uses PSR-4 standards for autoloading the generated migrations out of the configured migrations directory.

Advanced Baleen CLI users can overwrite the class generator to fit the needs of their project.

Adding Your Code

If you open a migration file you’ll see it has two empty methods: up() and down(), which will be called when migrating upwards or downwards (respectively). You can put any code you want inside those methods - for example code to transform your database, an image, a document, etc. - anything you want to migrate!