No description
Find a file
Vítězslav Dvořák 1ba0f89442 build pipelines update
2026-01-26 13:40:27 +01:00
.github Bump actions/cache from 4 to 5 (#2403) 2025-12-15 08:13:52 +01:00
app Update to new code sniffer. 2021-06-02 14:18:55 +02:00
bin move phinx bootstrapping into app/phinx.php, use with bin/phinx 2014-11-17 14:42:39 -06:00
data Move data directory out of src to root 2020-04-11 06:24:57 +03:00
debian build pipelines update 2026-01-26 13:40:27 +01:00
docs Use timestamp column type for phinxlog if addTimestampsUseDateTime flag disabled (#2401) 2025-12-14 16:57:35 +00:00
src Improves migration error message for missing tables 2026-01-07 00:10:10 +01:00
tests Improve quote behavior of CURRENT_TIMESTAMP default (#2389) 2025-11-17 13:16:16 -07:00
.editorconfig Update all links to use https (#2120) 2022-10-11 04:55:46 +00:00
.gitattributes Fix up gitignore 2023-11-12 13:05:35 +01:00
.gitignore v0.16.10 release 2026-01-06 19:40:33 +01:00
.stickler.yml Use CakePHP 3 code standard for stickler 2020-09-30 15:20:21 -04:00
box.json Show version in CLI (#2291) 2024-06-14 13:01:09 +00:00
composer.json Update symfony/console requirement from ^6.0|^7.0 to ^6.0|^7.0|^8.0 (#2396) 2025-12-04 21:43:39 -07:00
CONTRIBUTING.md Make local prefer lowest checking easier. 2023-11-09 20:51:49 +01:00
docker-compose.yml Merge pull request #1855 from MasterOdin/docker_compose 2020-08-14 12:02:28 +02:00
Dockerfile Bump dockerfile to php 7.3 2023-03-01 14:04:40 +00:00
docs.Dockerfile Update source files path. 2022-03-23 17:47:23 +01:00
LICENSE Update license copyright to CakePHP Software Foundation (#2170) 2023-01-06 23:43:18 -05:00
phpcs.xml Fix CS 2025-10-22 04:34:42 +02:00
phpstan-baseline.neon Update symfony/console requirement from ^6.0|^7.0 to ^6.0|^7.0|^8.0 (#2396) 2025-12-04 21:43:39 -07:00
phpstan.neon Fix deprecations in phpstan config (#2387) 2025-11-04 17:25:58 +00:00
phpunit.xml.dist Add deprecation warning for Util::mapClassNameToFileName (#2327) 2024-11-30 20:29:38 +00:00
README.md Fix build status README badge (#2356) 2025-05-22 11:05:07 -04:00

Phinx: Simple PHP Database Migrations

CI Code Coverage Packagist Version Minimum PHP Version Packagist Downloads

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 book.cakephp.org/phinx 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

See version and branch overview for branch and PHP compatibility.

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 https://book.cakephp.org/phinx for the comprehensive documentation.

Other translations include:

Contributing

Please read the CONTRIBUTING document.

News & Updates

Follow @CakePHP on Twitter to stay up to date.

Limitations

PostgreSQL

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.