PHP Database Migrations for Everyone

Overview

Phinx: Simple PHP Database Migrations

Build Status Code Coverage Latest Stable Version Minimum PHP Version Total 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 (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

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.

Comments
  • Multiple Databases

    Multiple Databases

    It would be cool if Phinx could handle migrations for different databases all from the same instance. In our company setup we have one application which uses n databases, with different migrations for each that need to be handled.

    What are you thoughts on handling multiple databases? I might fork and see if I can get it working but I want to know if you'd ever merge something like that?

    feature waiting on feedback 
    opened by wpillar 97
  • Create an Initial Migration from an Existing Database

    Create an Initial Migration from an Existing Database

    Is it possible for Phinx to create an initial migration from an existing database? My scenario is that I have an application with a database and it's tables already and I'd like to start using Phinx to handle my migrations (previously i was manually creating SQL scripts). I'd love if Phinx could inspect my database and create an initial migration file with the current table structures as a starting point.

    I hope that made sense.

    feature 
    opened by ylynfatt 82
  • Suggestion to add a seed()

    Suggestion to add a seed()

    A suggestion to add a seed() function that is defined inside any migration classes. If it exists, Phinx will run the seed() only after it runs up().

    I often need this to seed tables with initial data, which goes along with migration.

    feature 
    opened by CMCDragonkai 53
  • Add update and updateData methods

    Add update and updateData methods

    Added update and updateData methods. Also added a shortcut method for updating.

    @rquadling @robmorgan I'm sure there may be changes needed. Please let me know and I'll implement ASAP.

    Thanks for the opportunity to work with you.

    Fixes #862

    feature 
    opened by BallisticPain 47
  • Rollbacks by start time

    Rollbacks by start time

    A new Configuration option named version_order was added. Its possible values are:

    • creation-time (the default): causes the Rollback and Status commands to order the executed migrations by their creation times (aka Migration IDs or Names).
    • start-time: causes the Rollback and Status commands to order the executed migrations by their start times (aka Execution Times).

    This means that when invoking the Rollback command:

    • With a start-time version order, the last executed migration will be rollbacked.
    • With a start-time version order and a -d (date) option, the migration start times will be used to determine the target version to rollback to. In other words, all migrations which were executed after that date will be rollbacked.
    • With a start-time version order and a -t (target version) option, all migrations which were executed after the target version was executed will be rollbacked.

    In terms of testing:

    • The old testRollbacksByDate test was renamed to testRollbackToDateTime and turned into a unit test, ensuring the rollback method is called with the right target version. A new testRollback was added which ensures the correct output of the rollback operation (as was being done in the old testRollbacksByDate test).
    • More test cases were added.
    • General test improvements were done (like adding the expected arguments to the underlying Manager calls in RollbackTest and StatusTest.

    Other notes:

    • The old rollback and rollbackToDateTime methods were merged into a single rollback method that handles all cases and version orders.
    • This PR replaces https://github.com/robmorgan/phinx/pull/745.
    opened by ghost 42
  • Support for UPDATE & DELETE methods?

    Support for UPDATE & DELETE methods?

    Rob, have you given any thought to creating insert, update, and delete methods instead of having queries written inline?

    I don't know that they'd add any specific functionality, but something like the way Zend_Db (v1, not v2) does would be nice to have.

    feature 
    opened by gms8994 37
  • Implemented Dry Runs

    Implemented Dry Runs

    A new --dry-run option was added to the Migrate and Rollback commands, which causes the executed/rollbacked Migrations Code to be outputted instead of executed.

    Technically speaking, I implemented it in a way that the new option is passed from the Migrate and Rollback Commands to the Manager class, whose executeMigration method was updated to print a different text header for the migrations being executed/rollbacked when dry-running. The parameter is then passed on to the Environment class' executeMigration method which enables dry-running in the PDOAdapter. Finally, when a statement is executed via the PDOAdapter.execute method, if dry-running was enabled it simply prints the SQL code and returns, instead of actually executing it via the underlying database connection.

    For #567 and based on https://github.com/wheniwork/phinx/pull/1

    opened by ghost 36
  • Add debug option to show raw SQL

    Add debug option to show raw SQL

    Sometimes when trying to run migration and failing for weird database errors it's hard to debug the problem without knowing what exact SQL is being issued against the server. The --verbose option shows what Phinx is trying to do, but not exactly how.

    Maybe another option -vv or --debug could show the commands sent to the server?

    feature 
    opened by igorsantos07 30
  • Support pre and post migrations for zero-downtime deployments

    Support pre and post migrations for zero-downtime deployments

    It is common to run migrations at deploy time, and those migrations are often split into pre- and post-deploy migrations. Pre-deploy migrations affect the current version of the app for a few moments before the new version is deployed. Post-deploy migrations are only applied after the new version has been deployed. This is to ensure no errors occur during a live, zero-downtime deployment.

    For example, new columns are usually added during pre-deploy, because if those columns are not present the moment the new version goes live, errors will occur because the app will try to access non-existent columns. Deleted columns should often be removed during post-deploy, because if they are removed whilst the current app version is running, errors will occur because the current version may still be trying to access them.

    To support these two types of migrations, there needs to be a mechanism to mark a given migration is either pre or post and the migration command must accept an option to toggle which migration subgroup is being targeted. This changes migration command behaviour from one-pass two two-pass style, where the command must be invoked twice - once for each migration subgroup - to perform the complete migration.

    Key discussion points

    1. Should we implement this feature?
    2. How should migrations be marked as pre and post?
    3. Should a new migration command be added or should the existing command be repurposed to support this behaviour with additional arguments or options?
    opened by Bilge 28
  • Error when trying to run init

    Error when trying to run init

    platform: windows8 trying to run: php vendor/bin/phinx init output result: SRC_DIR="pwd" cd "dirname "$0"" cd "../robmorgan/phinx/bin" BIN_TARGET="pwd/phinx" cd "$SRC_DIR" "$BIN_TARGET" "$@"

    bug 
    opened by ahmarov 27
  • Supporting namespaces in configuration, Migrations and Seeds.

    Supporting namespaces in configuration, Migrations and Seeds.

    Please consider my pull request, in which I made some enhancement. The pull request fixes following issues:

    • #168 Move migrations under the Phinx\Migration namespace
    • #756 Namespace loading failed
    • #1054 BUG: The same migration name can be created in multiple directories. (if add namespace in configuration)

    I implemented an idea of @rquadling (view comment). So, support of namespaces looks like this: php like:

    return [
        'paths' => [
            'migrations' => [
                '/path/to/migration/without/namespace',
                'Foo' => '/path/to/migration/Foo',
            ],
            'seeds' => [
                '/path/to/seeds/without/namespace',
                'Baz' => '/path/to/seeds/Baz',
            ]
        ],
    ];
    

    yaml like:

    paths:
        migrations:
          0: ./db/migrations
          Foo\Bar: ./db/FooBar
        seeds:
          0: ./db/seeds
          Foo\Bar: ./db/seeds/Foo/Bar
    

    json like:

    {
        "paths": {
            "migrations": {
                "0": "./db/migrations",
                "Foo\\Bar": "./db/FooBar"
            }
        }
    }
    
    

    Migrations/Seeds contain namespace just at the beginning of the file.

    Migrations/Seeds files without namespace are still working for backward compatibility.

    For using namespaces in migrations/seeds make new folders and change configuration.

    The solution doesn't fully compatible with PSR-4 (there are versions in file names).

    I tryed to covered the code with the unit's tests as full as possible.

    enhancement 
    opened by andrey-mokhov 25
  • Add feature flags to disable some breaking changes

    Add feature flags to disable some breaking changes

    PR to address comments in #2154

    A new FeatureFlags class has been introduced that we can use to wrap larger breaking changes, such that end-users may optionally disable them.

    enhancement 
    opened by MasterOdin 3
  • add fix for mariadb virtual column creation

    add fix for mariadb virtual column creation

    When using virtual column definition with Literal class, migration fails with SQL syntax error on MariaDB as NOT NULL or NULL are not allowed at the end of column definition. Below is the link to an issue.

    Fixes https://github.com/cakephp/phinx/issues/2157

    bug 
    opened by oskarkregar 3
  • Run Phinx migrations parallel on multiple database exhaust the CPU

    Run Phinx migrations parallel on multiple database exhaust the CPU

    • While running phinx migration on multiple databases always exhaust the database CPU

    Use Case 1 database has 17 migrations to execute and there are total of 500 database, I am running 20 in PARALLEL but it always throw below error after executing few. PDOException: SQLSTATE[HY000] [2002] Connection refused in /composer/vendor/robmorgan/phinx/src/Phinx/Db/Adapter/PdoAdapter.php:83 Stack trace: #0 /composer/vendor/robmorgan/phinx/src/Phinx/Db/Adapter/PdoAdapter.php(83): PDO->__construct('mysql:host=127....', 'dbuser', 'dbpassword', Array)

    opened by Mubasher-iqbal 0
  • Phinxlog insert is not part of migration transaction

    Phinxlog insert is not part of migration transaction

    == 20221128213727 AddContactIdToPerson: migrating START TRANSACTION ALTER TABLE person ADD contact_id INT(11) NULL COMMIT INSERT INTO phinxlog (version, migration_name, start_time, end_time, breakpoint) VALUES ('20221128213727', 'AddContactIdToPerson', '2022-11-28 21:40:06', '2022-11-28 21:40:06', 0); == 20221128213727 AddContactIdToPerson: migrated 0.0116s

    should be

    == 20221128213727 AddContactIdToPerson: migrating START TRANSACTION; ALTER TABLE person ADD contact_id INT(11) NULL; INSERT INTO phinxlog (version, migration_name, start_time, end_time, breakpoint) VALUES ('20221128213727', 'AddContactIdToPerson', '2022-11-28 21:40:06', '2022-11-28 21:40:06', 0); COMMIT; == 20221128213727 AddContactIdToPerson: migrated 0.0116s

    bug 
    opened by JRDuncan 0
  • DEFAULT_GENERATED being added to queries.

    DEFAULT_GENERATED being added to queries.

    Versions:

    phinx: 0.11 mysql: 8+ pho: 7.2

    Refering to: https://github.com/dbeaver/dbeaver/issues/10797


    when creating a colum which has CURRENT_TIMESTAMP as the default value, mysql adds 'DEFAULT_GENERATED' into the extra column.

    This then gets added to any alter statements and causes a syntax issue.


    REPRODUCTION:

    ####Create a table with a datetime field with CURRENT_TIMESTAMP as the default value.

    CREATE TABLE `test_table` (
    	`id`  INT NOT NULL AUTO_INCREMENT,
    	`name` VARCHAR(80) NOT NULL,
    	`last_changed` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
    	PRIMARY KEY (`id`) USING BTREE
    )
    

    ####using phinx to rename the column

    public function change(){
        $this->table('test_table')
                ->renameColumn('last_changed', 'updated_at')
                ->update();
    }
    
    opened by larsgullestrup 0
Releases(0.13.3)
  • 0.13.3(Dec 8, 2022)

    Fixes

    • Fix string to int return type by @dereuromark in https://github.com/cakephp/phinx/pull/2150
    • Fix rolling back columns with indices for SQLite and SQL Server by @ndm2 in https://github.com/cakephp/phinx/pull/2128
    • Add testcases for Util::getVersionFromFileName function by @MasterOdin in https://github.com/cakephp/phinx/pull/2153
    • Fix reference to MysqlAdapter::FIRST constant in migrations doc by @niekatywny in https://github.com/cakephp/phinx/pull/2143

    Full Changelog: https://github.com/cakephp/phinx/compare/0.13.2...0.13.3

    Source code(tar.gz)
    Source code(zip)
    phinx.phar(1.99 MB)
  • 0.13.2(Nov 30, 2022)

    Fixes

    • Maintain indexes / triggers after altering sqlite tables by @MasterOdin in https://github.com/cakephp/phinx/pull/2040
    • Fix documentation seeder_base_class configuration by @N-Silbernagel in https://github.com/cakephp/phinx/pull/2124
    • Fix deprecated ${} string interpolation by @rigrig in https://github.com/cakephp/phinx/pull/2133
    • Fix enum by @dereuromark in https://github.com/cakephp/phinx/pull/2140

    New Contributors

    • @Arhell made their first contribution in https://github.com/cakephp/phinx/pull/2120
    • @N-Silbernagel made their first contribution in https://github.com/cakephp/phinx/pull/2124
    • @rigrig made their first contribution in https://github.com/cakephp/phinx/pull/2133
    • @nono-lqdn made their first contribution in https://github.com/cakephp/phinx/pull/2137

    Full Changelog: https://github.com/cakephp/phinx/compare/0.13.1...0.13.2

    Source code(tar.gz)
    Source code(zip)
    phinx.phar(1.99 MB)
  • 0.13.1(Oct 11, 2022)

    Fixes

    • Fix target being set to 0 if omitted when running migrate by @nrob81 in #2115
    • Fix deprecation warning on return value for Config::offsetGet by @MasterOdin in #2117

    Full Changelog: https://github.com/cakephp/phinx/compare/0.13.0...0.13.1

    Source code(tar.gz)
    Source code(zip)
    phinx.phar(1.99 MB)
  • 0.13.0(Oct 6, 2022)

    Breaking Changes

    • set column null by default unless identity by @MasterOdin in #1872. Previously columns were created as NOT NULL by default, and to now get that behavior, you will need to explicitly pass 'null' => false in the column options.
    • remove remove $direction argument to preFlightCheck and postFlightCheck (use isMigratingUp property) by @MasterOdin in #1892
    • make utf8mb4 default charset and collation for new mysql tables by @MasterOdin in #1875 (Set charset and collation setting in phinx.php to utf8mb3 for prior behavior)
    • make default PKs for mysql unsigned by default by @MasterOdin in #1899. When defining foreign keys, you will need to now need to set $signed => false. To restore prior behavior, pass $signed => true when defining the default PK.
    • Add type hints to codebase by @MasterOdin in #1995 (This does not affect the up, down, or change methods for AbstractMigration. If you extend from phinx, you will need to add type hinting to your code)
    • remove deprecated hasSchemaTable function from AdapterInterface by @MasterOdin in #1877
    • remove deprecated insert, dropTable methods from MigrationInterface by @MasterOdin in #1878
    • Do not set code when recasting PDOException when connecting to DB by @MasterOdin in #2101
    • Implement identity in PostgresAdapter by @ajibarra in #2085 (identity columns for postgres 10+ will now be generated as INTEGER NOT NULL GENERATED ALWAYS AS IDENTITY instead of SERIAL NOT NULL)

    Deprecations

    • Deprecate the default_migration_table config setting, use migration_table instead by @MasterOdin in #1961

    New Features

    • add createSchema and dropSchema methods on MigrationInterface by @MasterOdin in #1871

    Improvements

    • remove check on column type for setting collation / encoding by @Masterodin in #1881
    • trigger deprecation notice when using default_database by @MasterOdin in #1890 (function had been marked as deprecated in 0.12.0)
    • add support for smallserial alias for postgres by @MasterOdin in #1915 (note, using smallinteger on an identity column will now use the type smallserial)
    • allow setting migration_table per environment by @MasterOdin in #1961
    • Add new shouldExecute method to AbstractMigration and AbstractSeed by @AdrienPoupa in #1939
    • Add for geometry column type to SqlServerAdapter by @tedce in #1969
    • Add optional $params argument to query/execute adapter methods to allow usage of prepared queries by @MasterOdin in #1962
    • Allow specifying template style for create command by @MasterOdin in #2013 (note, the name of the base migration file has changed, argument has changed for AbstractCommand::getMigrationTemplateFilename)
    • Improve associative array phpdocs by @dereuromark in #2034
    • Pass environment to seed from manager by @martenb in #2102 (note, parameter change to Manager::getSeeds method)

    Full Changelog: https://github.com/cakephp/phinx/compare/0.12.13...0.13.0

    Source code(tar.gz)
    Source code(zip)
    phinx.phar(1.99 MB)
  • 0.12.13(Oct 3, 2022)

  • 0.12.12(Jul 15, 2022)

    Fixes

    • Fix setting persistent option for PDO connection by @paulermo in https://github.com/cakephp/phinx/pull/2092
    • Fix SqlServerAdapter returning empty string instead of null for column default by @reeperbahnause in https://github.com/cakephp/phinx/pull/2090

    Full Changelog: https://github.com/cakephp/phinx/compare/0.12.11...0.12.12

    Source code(tar.gz)
    Source code(zip)
    phinx.phar(1.99 MB)
  • 0.12.11(Jul 4, 2022)

    Improvements

    • Add full text search index GIN type by @antoniovj1 in https://github.com/cakephp/phinx/pull/2066
    • Support sqlite query parameters by @swiffer in https://github.com/cakephp/phinx/pull/2053, https://github.com/cakephp/phinx/pull/2083
    • Add setting DSN options for SqlServerAdapter by @ingLomeland in https://github.com/cakephp/phinx/pull/2094

    Full Changelog: https://github.com/cakephp/phinx/compare/0.12.10...0.12.11

    Source code(tar.gz)
    Source code(zip)
    phinx.phar(1.99 MB)
  • 0.12.10(Jan 21, 2022)

    Fixes

    • Fixed setting default for Blob, Geometry, Json, and Text for MySQL 8+
    • Fix using MysqlAdapter::INT_* constants as column limit
    • Properly return limit for MySQL columns that include it (e.g. smallint(5))
    • Fix adding columns to sqlite tables created externally from phinx

    Improvements

    • Do not print information output with option --no-info
    • Remove decimal from unsupported sqlite types list
    • Mark compatibility with Symfony 6.x
    Source code(tar.gz)
    Source code(zip)
    phinx.phar(1.97 MB)
  • 0.12.9(Oct 12, 2021)

    Fixes

    • Fixed renaming table not using prefix/suffix on new name
    • Fixed changing boolean column option's in PostgreSQL, this was a regression of previous release patch that is now resolved

    Improvements

    • PHP 8.1 compatibility
    Source code(tar.gz)
    Source code(zip)
    phinx.phar(1.90 MB)
  • 0.12.8(Sep 1, 2021)

    Fixes

    • Fixes issue with MySQL Adapter primary key getter

    Improvements

    • Expose hasPrimaryKey() method in Table object. This mirrors the existing hasForeignKey() function.
    • Postgres: Allow change from int to bool and char to uuid
    • Allow setting column to false to ignore it in addTimestamps()/addTimestampsWithTimezone methods. This is useful if not both fields are used.
    • Adding the mediumint type for the MySql adapter
    Source code(tar.gz)
    Source code(zip)
    phinx.phar(1.90 MB)
  • 0.12.7(May 18, 2021)

    Fixes

    • Fixed error when creating a foreign key on a table without an autoincrementing primary key in SQLite

    Improvements

    • Support for psr/container v2
    Source code(tar.gz)
    Source code(zip)
  • 0.12.6(Mar 16, 2021)

  • 0.12.5(Jan 21, 2021)

    Fixes

    • Fix not being able to set limit on big integer for MySQL
    • Run preFlightCheck and postFlightCheck immediately after migration
    • Ensure a default of CURRENT_TIMESTAMP(3) is not quoted in MySQL
    • Fix PDO exception not being thrown when trying to add column to non-existent table in SQLite
    • Better handle specifying schema in configuration file and inline migrations for postgresql Since phinx did support this at one time and then it broke

    Improvements

    • Support setting order for indexes
    • Add ability to set generic PDO attributes
    • Support for include clause when adding an index
    • Support looking up foreign key by name in sqlite3
    • Support for tinyint and smallint in SQL Server
    • Automatically handle casting when changing column to bigint, smallint, int on postgresql
    Source code(tar.gz)
    Source code(zip)
    phinx.phar(1.84 MB)
  • 0.12.4(Aug 18, 2020)

    Fixes

    • Fixed adding columns to existing SQLite table with table constraints
    • Fixed problems in SQLite Adapter around foreign key creation
    • Fixed renaming columns in mixed case table in Postgres
    • Fix error when using Phinx with MySQL 8.0.21+

    Improvements

    • Added support for decimal in SQLite adapter
    • Added support for native Mysql blob types and fallback for binary
    • Removed cakephp/collection dependency
    Source code(tar.gz)
    Source code(zip)
  • 0.12.3(Jun 26, 2020)

  • 0.12.2(Jun 24, 2020)

    Fixes

    • Fixed issue around tinyint(1) and bool detection
    • Fixed default/update values for addTimestamps columns

    Improvements

    • Support user-configured DI container
    • Added further support for tinyint and binary UUID
    • Added support for configuring test DB through DSN
    • Allow name to be optional for create command
    • Relaxed migration & seed class name restrictions
    Source code(tar.gz)
    Source code(zip)
  • 0.11.7(May 12, 2020)

    Fixes

    • Do not throw an exception for missing phinxlog for dry-run
    • Adjusted the composer constraints to include the symfony/yaml component again.
    Source code(tar.gz)
    Source code(zip)
  • 0.12.1(Apr 11, 2020)

  • 0.12.0(Apr 9, 2020)

    Breaking Changes

    • Minimum of PHP 7.2 required now.
    • cakephp/database>=4.0 now required. This could impact migrations/seeds that use the query APIs.
    • In environment configuration default_database is now default_environment.

    New Features

    • Upgraded to PHPUnit 8.0
    • Added setDataDomain(), getDataDomain(), and getColumnForType() to adapters.
    • Improved SQLite column add functionality.
    • SQLite now creates columns as NOT NULL by default, regardless if a default value for the column is specified or not. This brings it in line with how the other adapters work.
    Source code(tar.gz)
    Source code(zip)
  • 0.11.6(Apr 6, 2020)

  • 0.11.5(Apr 5, 2020)

    Fixes

    • Fixed schema table not being properly quoted in some queries
    • $_ENV is mixed with $_SERVER for getting replacement config tokens
    • Fixed DSN handling in Migrate and Seed commands

    Improvements

    • Improved Wrapper to support status command in JSON format
    • Made YAML extension optional.
    • Raise error on ignored primary key.
    Source code(tar.gz)
    Source code(zip)
  • 0.11.4(Dec 24, 2019)

    Included commits: https://github.com/cakephp/phinx/compare/0.11.3...0.11.4

    Fixes

    • Fixed offset warning shown when using invalid version for breakpoint

    Improvements

    • Added fetch_mode option support for PDO adapter
    • Print version order when running migrate
    • Allow setting SRID for geometry types
    Source code(tar.gz)
    Source code(zip)
  • 0.11.3(Dec 12, 2019)

  • 0.11.2(Dec 8, 2019)

    Fixes

    • SQLite fixes
    • Do not print out status table when specifying --format json

    Improvements

    • PHP 7.4 compatibility
    • Symfony 5 compatibility
    • Introduced new command to list migration template creation aliases
    Source code(tar.gz)
    Source code(zip)
  • 0.11.1(Aug 28, 2019)

    Bug Fixes

    • Fixed version in composer.json
    • Fixed minimum versions of dependencies #1592

    Other Changes

    • Use $defaultName instead of COMMAND_NAME in command classes. #1596
    • Added prefer-lowest build to travis. #1592
    Source code(tar.gz)
    Source code(zip)
  • v0.11.0(Aug 28, 2019)

    Bug Fixes

    • Fixed command names to fix breaking changes in symfony/console #1588
    • Fixed missing ; when using --dry-run #1573
    • Fix inserting multiple rows without zero key #1566
    • Fix option names in exception message.

    New Features

    • AdapterWrapper::hasDatabase() now has a return value #1572

    Other Changes

    • Improved test coverage with postgres #1577
    • Update PHPUnit version constraint #1591
    • Updated travis build configuration.
    Source code(tar.gz)
    Source code(zip)
  • v0.10.8(Jul 8, 2019)

    Bug Fixes

    • [PDO & SQLite] Quoting (#1542)
    • [Postgres] Fix truncate table (#1555, #1474)
    • [SQLite] Fix truncate table (#1556)
    • [SQLite] Fixes to index handling (#1545)
    • [SQLite] Improved dropDatabase, and other minor fixes (#1533)
    • [SqlServer] Fix SqlServer syntax after making precision alias of limit (#1529)

    New Features

    • Add double type (#1493)
    • Introduce --set and --unset options for breakpoints (#1560)
    • [SQLite] Implement hasPrimaryKey and hasForeignKey (#1548)
    • [SQLite] New implementation of getColumns (#1554)

    Other Changes

    • Document that double is now a valid column type (#1527)
    • Enable testing for PHP 7.3
    • Typos in documentation (#1525)
    • Updated documentation regarding the use of saveData() rather than save() in seeds (#1473)
    Source code(tar.gz)
    Source code(zip)
  • v0.10.7(Apr 25, 2019)

    Bug Fixes

    • Several bug fixes introduced in 0.10 related to the batching of alter table statements (#1523)
    • Fixed DSN parsing (#1433)
    • SQLite Adapter now respects LIMIT on CHAR typed columns (#1518)
    • Fixes decimal info getColumns() (#1466)
    • Prevent data insertion when passing an empty array (#1496)
    • Quote column names when running CHECK command (#1444)

    New Features

    • Add double type (#1493)
    • Add Exit Status 1 on Exception (#1462)
    • Non integer primary sqlite (#1450)
    • Add feature to be able to define a boostrap script (#1455)
    • Add small integer support to all Mysql, SqlServer and Sqlite (#1438)
    • Make removeIndex work with one column as a string (#1437)
    Source code(tar.gz)
    Source code(zip)
  • v0.10.6(Aug 12, 2018)

    Bug Fixes

    • Fixed wrong SQL used when adding new columns to a table in SQLite
    • Do not output all migrations in the -vvv output when running migrations every single time.

    New Features

    • Ability to change the primary key and table comment
    • Added Table::getColumn() method
    Source code(tar.gz)
    Source code(zip)
  • v0.10.5(Jul 12, 2018)

Framework agnostic database migrations for PHP.

Phoenix Framework agnostic database migrations for PHP. Features Validation all settings in migration before executing first query Multiple migration

Michal Lulco 148 Nov 19, 2022
Simple migrations system for php

Phpmig What is it? Phpmig is a (database) migration tool for php, that should be adaptable for use with most PHP 5.3+ projects. It's kind of like doct

Dave Marshall 561 Jan 1, 2023
php 5.3 Migration Manager

#What are Database Migrations? Migrations are a convenient way for you to alter your database in a structured and organized manner. You could edit fra

Lewis Dyer 38 Sep 28, 2022
PHP Database Migrations for Everyone

Phinx: Simple PHP Database Migrations Intro Phinx makes it ridiculously easy to manage the database migrations for your PHP app. In less than 5 minute

CakePHP 4.3k Jan 7, 2023
Database migrations for PHP ala ActiveRecord Migrations with support for MySQL, Postgres, SQLite

Introduction Ruckusing is a framework written in PHP5 for generating and managing a set of "database migrations". Database migrations are declarative

Cody Caughlan 506 Nov 17, 2022
Laravel Migrations Generator: Automatically generate your migrations from an existing database schema.

Laravel Migrations Generator Generate Laravel Migrations from an existing database, including indexes and foreign keys! Upgrading to Laravel 5.4 Pleas

Bernhard Breytenbach 3.3k Dec 30, 2022
Laravel Migrations Generator: Automatically generate your migrations from an existing database schema.

Laravel Migrations Generator Generate Laravel Migrations from an existing database, including indexes and foreign keys! This package is cloned from ht

Kit Loong 1.4k Jan 1, 2023
Framework agnostic database migrations for PHP.

Phoenix Framework agnostic database migrations for PHP. Features Validation all settings in migration before executing first query Multiple migration

Michal Lulco 148 Nov 19, 2022
Validate PHP database migration files for compliance with best practices. Ensure db migrations are irreversible.

PHP DB Migration Validator Introduction In modern PHP frameworks such as Symfony and Laravel, migrations usually have up and down methods. In up metho

Anton Komarev 17 Dec 14, 2022
A Simple MVC PHP Framework, integrated with lot of features such as Session, Cookies, Migrations, Database, Factories, Seeding, Bootstrap and Tailwind CSS

Navite A Simple MVC PHP Framework, integrated with lot of features such as Session, Cookies, Migrations, Database, Factories, Seeding, Bootstrap and T

Celionatti 2 Aug 22, 2022
Generate migrations from existing database structures

Laravel Migration Generator Generate migrations from existing database structures, an alternative to the schema dump provided by Laravel. A primary us

Bennett Treptow 404 Jan 1, 2023
The MX_PhinxMigrations module integrates Phinx database migrations into Magento 2

MX Phinx Migrations About The MX_PhinxMigrations module integrates Phinx database migrations into Magento 2 as a replacement for the built-in setup:up

Inviqa 34 Jul 30, 2021
Declare database migrations and factory definitions inside Laravel models.

Lucid This package allows you to declare database migrations and factory definitions inside of your Laravel models. Running the lucid:migrate command

null 23 Jul 9, 2022
Laravel ClickHouse adds CH client integration, generation & execution of ClickHouse database migrations to the Laravel application.

Laravel ClickHouse Introduction Laravel ClickHouse database integration. This package includes generation and execution of the ClickHouse database mig

cybercog 11 Dec 20, 2022
📛 An open source status page system for everyone.

Cachet is a beautiful and powerful open source status page system. Overview List your service components Report incidents Customise the look of your s

Cachet 13k Jan 3, 2023
Laravel API starter Kit will provide you with the tools for making API's that everyone will love

Laravel API Starter Kit Laravel API starter Kit will provide you with the tools for making API's that everyone will love, API Authentication is alread

Jose Luis Fonseca 400 Dec 29, 2022
📛 An open source status page system for everyone.

Cachet is a beautiful and powerful open source status page system. Overview List your service components Report incidents Customise the look of your s

Cachet 13k Dec 31, 2022
Photo Sharing. For Everyone.

Introduction A free and ethical photo sharing platform, powered by ActivityPub federation. Official Documentation Documentation for Pixelfed can be fo

PixelFed 4.4k Jan 7, 2023
a framework for WebDevelop based on the mvc structure. The name of this project for Fun because everyone can use it. Completely simple and powerful structure for all your projects

A_A (-.-) ▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄ |-| █▄─▄▄─█▄─██─▄█─▄▄▄▄█─▄▄▄▄█▄─█─▄█─▄▄▄─██▀▄─██─▄

MasihGhaznavi 7 Jun 29, 2022
Just a simple Framework for Furries (or everyone)

FurrWork A simple framework for Furries (Or Everyone). This is a little framework of FurrApp Project Estructure app folder config The config files (De

null 1 Nov 11, 2021