Download the PHP package tcdev/migrant without Composer

On this page you can find all versions of the php package tcdev/migrant. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package migrant

Migrant -- Database migration tool

Build Status Latest Stable Version Total Downloads Latest Unstable Version License

Description

This is a simple database migration tool for automating versioning between copies of the same database on different environments.

The design goal for this package was to provide a easily memorable command-line interface for a program that would allow the developer to use native SQL code for the migrations themselves, including the ability to drop in the output from a database dump as the first migration and have that code execute properly.

Installation

Add the dependency. https://packagist.org/packages/fluxoft/migrant

{
    "require": {
        "fluxoft/migrant": "dev-master"
    }
}

Download the composer.phar

curl -sS https://getcomposer.org/installer | php

Install the library.

php composer.phar install

Usage

Once Migrant is installed in your Composer vendor directory for the project, you will just need to make a folder to keep your migration set up (I usually make a "db" folder at the same level as my "vendor" folder in the root of my project).

Migrant is used by passing it a series of command-line arguments. There are 5 recognized commands:

init

To initialize your migrant directory:

../vendor/bin/migrant init

This will create a migrant.ini file where you will need to set up your database connections for your various environments and a migrations folder where new migrations are created.

add

Next, either add a migration file manually or by using "migrant add" to create one in your migrations folder:

../vendor/bin/migrant add example

The command above will create a file named something like "migrations/20150219114901_example.sql" with a blank migration template. Open that file and add the SQL that should be run for both the "up" and "down" migrations. Make sure to leave the line "-- //@UNDO" intact between the up and the down. If you create your own migration, keep in mind that the integer before the first slash is used as the sorting key, so if you use an integer with fewer characters than 14 (by default "migrant add" uses the year, month, date, hour, minute, and second as the sort value), migrations may appear out of order.

For instance, the following files:

Are actually executed in the following order:

up

When you are ready to migrate, run the "up" command:

migrant up

This will run all available migrations against the "development" environment. To specify a different environment:

migrant up production

To migrate up to a specific revision number and no further:

migrant up 20150220123456

...or to this revision on the production environment:

migrant up 20150220123456 production

down

If you need to roll back a migration, the "down" command works in much the same way as the "up" command:

migrant down

The key difference is that "down" will only roll back a single revision at a time unless a target revision is given:

migrant down 20141231235959

To roll back every migration, specify "0" as the target revision:

migrant down 0

As with "down" a specific environment can be given as the last argument:

migrant down testing

status

To see all available migrations and to see which ones have been run, use the "status" command.

As with the other commands, this command will accept an environment name but runs against "development" by default:

migrant status production

Help

To get the inline help, simply run migrant with no arguments:


All versions of migrant with dependencies

PHP Build Version
Package Version
Requires php Version >=5.4.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package tcdev/migrant contains the following files

Loading the files please wait ....