Download the PHP package php-database-migration/php-database-migration without Composer

On this page you can find all versions of the php package php-database-migration/php-database-migration. 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 php-database-migration

PhpDbMigration - full PHP database migration tool

Build Status [Packagist]() Version

SensioLabsInsight

This is a full standalone PHP tool based on Symfony Console and inspired by the Rails database migration tool and MyBatis. It merges the functionality of the two tools and has been designed to be as flexible as possible.

Usage

Installing it to your project

Just add it to your composer.json (don't forget to specify your bin directory) Warning, all migrate commands must be executed on your root folder like bin/migrate migrate:command...

{
    "name": "jdoe/testproject",
    "authors": [
        {
            "name": "Jhon DOE",
            "email": "[email protected]"
        }
    ],
    "require": {
        "php-database-migration/php-database-migration" :"3.6.*"
    },
    "config": {
        "bin-dir": "bin"
    }
}

Adding an environment

The first thing to do before playing with SQL migrations is to add an environment, let's add the dev one.

You will be prompted to answer a series of questions about your environment, and then a config file will be saved in ./.php-database-migration/environments/[env].yml.

Initialization

Once the environment is added, you have to initialize it. This verifies that the database connection works, and creates a new database table for tracking the current database changes:

Create a migration

It is time to create our first migration file.

Migrations file are like this

-- // add table users
-- Migration SQL that makes the change goes here.
create table users (id integer, name text);
-- @UNDO
-- SQL to undo the change goes here.
drop table users;

List migrations

View all available migrations and their status.

Up and down

You can now up all the pending migrations. If you decide to down a migration, the last one will be downed alone to prevent mistakes. You will be asked to confirm the downgrade of your database before running the real SQL script.

You can mark migrations as applied without executing SQL (e.g. if you switched from another migration system)

For development purposes, it is also possible to up a single migration without taking care of the other ones:

or migrate to specific migration (it will run all migrations, including the specified migration)

Same thing for down:

or


All versions of php-database-migration with dependencies

PHP Build Version
Package Version
Requires php Version >=5.3.0
symfony/console Version ~2.6|~3.0
symfony/process Version ~2.6|~3.0
symfony/config Version ~2.6|~3.0
cocur/slugify Version ~1.0
symfony/yaml Version ~2.6|~3.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 php-database-migration/php-database-migration contains the following files

Loading the files please wait ....