Skip to content
PHP Database Migrations for Everyone
PHP Other
  1. PHP 99.9%
  2. Other 0.1%
Branch: master
Clone or download
dereuromark Merge pull request #1622 from MasterOdin/invalid_environment
Print error when using invalid environment
Latest commit 4dfbaaa Oct 14, 2019
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
app Fix code style in app directory Oct 16, 2017
bin move phinx bootstrapping into app/phinx.php, use with bin/phinx Nov 17, 2014
docs Bump docs version Aug 28, 2019
src fix phpstan error on return value Oct 13, 2019
tests Fix test failures on windows Oct 13, 2019
.editorconfig Remove redundant data Aug 28, 2019
.gitattributes Add more files to gitattributes export-ignore Oct 16, 2017
.gitignore Reverse "fix .gitignore" Oct 17, 2016
.scrutinizer.yml Use codecov for test coverage. Sep 15, 2017
.stickler.yml Please, help me stickler May 6, 2018
.travis.yml Merge pull request #1605 from cakephp/master-php74 Aug 29, 2019
CONTRIBUTING.md Updated links Dec 5, 2018
Dockerfile Update Dockerfile to use php:7.1 and update composer dependencies acc… Oct 22, 2018
LICENSE Update LICENSE Jan 2, 2019
README.md Simplify link. Aug 28, 2019
UPGRADE_0.6.md Renamed UPGRADE files Feb 28, 2017
UPGRADE_0.8.md Renamed UPGRADE files Feb 28, 2017
appveyor.yml Do not print out status table when specifying --format json Sep 23, 2019
box.json Fix box configuration to work with humbug/box to generate working phi… Apr 20, 2019
composer.json Bump version Aug 28, 2019
docker-compose.yml Add ability to specify limit for timestamp/date/time columns for mysql Mar 15, 2018
phinx.yml Added support for symfony 4 components. (#1224) Oct 25, 2017
phpcs.xml.dist PSR2 compliance. Sep 15, 2017
phpstan.neon Use phpstan v9 and fix reported errors. Apr 29, 2018
phpunit.xml.dist Simplify phpunit.xml file. Aug 28, 2019

README.md

Phinx: Simple PHP Database Migrations

Build Status Build status Code Coverage Latest Stable Version Total Downloads Join the chat at https://gitter.im/phinx-php/Lobby

Intro

Phinx makes it ridiculously easy to manage the database migrations for your PHP app. In less than 5 minutes, you can install Phinx and create your first database migration. Phinx is just about migrations without all the bloat of a database ORM system or framework.

Check out docs.phinx.org/en/latest/ (EN, ZH) for the comprehensive documentation.

phinxterm

Features

  • Write database migrations using database agnostic PHP code.
  • Migrate up and down.
  • Migrate on deployment.
  • Seed data after database creation.
  • Get going in less than 5 minutes.
  • Stop worrying about the state of your database.
  • Take advantage of SCM features such as branching.
  • Integrate with any app.

Supported Adapters

Phinx natively supports the following database adapters:

  • MySQL
  • PostgreSQL
  • SQLite
  • Microsoft SQL Server

Install & Run

Composer

The fastest way to install Phinx is to add it to your project using Composer (https://getcomposer.org/).

  1. Install Composer:

    curl -sS https://getcomposer.org/installer | php
    
  2. Require Phinx as a dependency using Composer:

    php composer.phar require robmorgan/phinx
    
  3. Install Phinx:

    php composer.phar install
    
  4. Execute Phinx:

    php vendor/bin/phinx
    

As a Phar

You can also use the Box application to build Phinx as a Phar archive (https://box-project.github.io/box2/).

  1. Clone Phinx from GitHub

    git clone https://github.com/cakephp/phinx.git
    cd phinx
    
  2. Install Composer

    curl -s https://getcomposer.org/installer | php
    
  3. Install the Phinx dependencies

    php composer.phar install
    
  4. Install Box:

    curl -LSs https://box-project.github.io/box2/installer.php | php
    
  5. Create a Phar archive

    php box.phar build
    

Documentation

Check out http://docs.phinx.org/en/latest/ for the comprehensive documentation.

Other translations include:

Contributing

Please read the CONTRIBUTING document.

News & Updates

Follow @CakePHP on Twitter to stay up to date.

Misc

Version History

Please read the release notes.

License

(The MIT license)

Copyright (c) 2017 Rob Morgan

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

You can’t perform that action at this time.