This repository has been archived by the owner on Apr 18, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 4
/
user.txt
54 lines (33 loc) · 1.64 KB
/
user.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
User's Guide
============
Installation
------------
Install with Composer:
.. code-block:: bash
composer install baleen/cli
Configuration
-------------
Then run the following command on the root directory of the project you want to migrate:
.. code-block:: bash
./vendor/bin/baleen init
This will create a configuration file called :file:`.baleen.yml` and a storage file at :file:`.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:
.. code-block:: bash
./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!