Repository navigation
Supported Versions: 8.2, 8.3, 8.4, 8.5 and 8.6
Added
- Added
@template-implements ArrayAccess<string, mixed>annotation toOptionStack(psalm compliance) (#167) - Added
Phalcon\Migrations\Db\Adapter\Mysql,Postgresql,Sqlite- schema introspection (columns, indexes, foreign keys, table options) and full DDL generation per driver (#167) - Added
Phalcon\Migrations\Db\Column,Index,Referencevalue objects replacing theirPhalcon\Dbcounterparts (#167) - Added
Phalcon\Migrations\Db\Connection- trimmed PDO wrapper covering all database operations (#167) - Added
Phalcon\Migrations\Db\PhalconColumnBridgefor transparent backward compatibility: migration files usingPhalcon\Db\Columncontinue to work without modification (#167) - Added
Phalcon\Utils\Camelizeto be used instead of the one from Phalcon (#167) - Added
migration migrate-filesCLI command to update existing migration files fromPhalcon\DbtoPhalcon\Migrations\Dbnamespace (#167) - Added
tests/Fakes/directory withMigrationFakeandMigrationCommandFaketest helpers; registeredPhalcon\Migrations\Tests\Fakes\PSR-4 namespace incomposer.json(#167) - Added
tests/unit/Sqlite/AdapterTest.phpcoveringtableExists(), primary key handling, function defaults, and index listing against an in-memory SQLite database, pluscurrent_timestamp()default tests for theMysqlandPostgresqladapters (#176) - Added backwards-compatibility fixtures in
tests/_data/backcompat/old/andtests/_data/backcompat/new/covering old-format (Phalcon\Db\*) and new-format (Phalcon\Migrations\Db\*) migrations across two versions each (create + alter column) (#167) - Added migration script to migrate existing migrations to new references; provision for running either migrations (old/refactored) (#167)
- Added rollback tests exercising
DIRECTION_BACKandcreatePrevClassWithMorphMethodto verify table structure is correctly restored when running migrations backwards (#167) - Added support for PHP 8.6; CI now runs code style, static analysis and tests on PHP 8.2 - 8.6 (#198)
Fixed
- Fixed PHPStan errors: removed dead
$mapproperty fromAdapterFactory, corrected@var SplFileInfoannotation, removed@methodannotations fromMigrationclass docblock that causedmethod_exists()to always evaluate to true, removed redundant@var Configannotation that made aninstanceofguard appear always-true (#167) - Fixed Psalm errors: unused
$referenceand$indexColumnsforeach values replaced with$_, unused$descriptionin first loop ofprintParameters()replaced with$_,realpath()false return handled explicitly, implicit__toStringcasts made explicit with(string), mixed int/float arithmetic inIncrementalItemmade type-safe with(int) pow()and intermediate$multipliervariable,addMinor()string+=int fixed with explicit(string)((int) $parts[0] + $number)(#167) - Fixed
MysqlandPostgresqladapters quoting the MySQL/MariaDB-stylecurrent_timestamp()default spelling as a string literal; function-default recognition is now shared across all adapters viaAbstractAdapter::isCurrentTimestampDefault(), PostgreSQL normalises the parenthesized spelling it does not accept and also applies function defaults in themodifyColumn()SET DEFAULTpath (#176) - Fixed
PhalconColumnBridge::fromPhalcon()preserving an empty-stringgetAfterPosition()fromPhalcon\Db\Columninstead of normalising it tonull; this causedAFTER ``in the generated ALTER SQL when adding columns from old-format migrations (#167) - Fixed
Sqlite::buildCreateTableSql()silently dropping primary keys declared with the generated-migrationPRIMARYindex convention (namePRIMARY/ typePRIMARY); a table-levelPRIMARY KEYclause is now emitted unless a column already renders asINTEGER PRIMARY KEY AUTOINCREMENT(#176) - Fixed
Sqlite::listIndexes()reporting internalsqlite_autoindex_*entries, which the table morph then attempted (and failed) to drop (#176) - Fixed
Sqliteadapter failing withnear "PRIMARY": syntax errorduring table morph; SQLite cannot add a primary key viaALTER TABLE, soaddPrimaryKey()is now a no-op consistent with the other unsupported SQLite DDL operations (#176) - Fixed
Sqliteadapter inheriting theinformation_schema.tablesbasedtableExists(), which made every migration run against SQLite fail withno such table: information_schema.tables; the existence check now queriessqlite_master(#176) - Fixed
Sqliteadapter storing function defaults as literal strings;CURRENT_TIMESTAMP,CURRENT_TIMESTAMP(), andNOW()are now emitted as the bareCURRENT_TIMESTAMPkeyword (#176) - Fixed
morphTable()passing the original$definitionarray (containing unconvertedPhalcon\Db\Column,Index,Referenceobjects) tocreateTable(); objects are now normalised toPhalcon\Migrations\Db\*types in-place during the column conversion loop, so old-format migration files work correctly on table creation (#167) - Fixed four
\$thissyntax errors intests/unit/Cli/RunTest.phpthat prevented the test suite from loading (#167) - Fixed typo in
Generate::checkEntityExists()error message:'Migration entity is e,pty'→'Migration entity is empty'(#167) - Fixed
.pharcompilation after moving the CLI entry point tobin/phalcon-migrations;box.jsonno longer lists the removed root script and writesphalcon-migrations.pharto the project root as the release workflow expects (#199)
Changed
- Added named static constructor methods to all exception classes returning
self, eliminating rawnew ExceptionClass('literal string')throw sites across the codebase (#167) - Changed Config file loading (
.ini,.json,.yaml) to now use native PHP functions (parse_ini_file,json_decode,yaml_parse_file) instead ofPhalcon\Configadapters (#167) - Changed
Observer/ProfilerandListeners/DbProfilerListenerwithoutPhalcon\Dbdependency; query timing output is unchanged (#167) - Changed minimum PHP version to 8.2 (#167)
- Changed test suite from Codeception to PHPUnit 11.5; all tests moved to a single
unitsuite undertests/unit/(#167) - Changed
vimeo/psalmto^7.1, which supports PHP 8.6; Psalm 7 reports code reached only through the public API as unused, soPossiblyUnusedProperty,UnusedProperty,UnusedMethodandUnusedConstructorare suppressed alongsidePossiblyUnusedMethod(#198) - Configured PHPStan at level 5 (embedded in
phpstan.neon.dist); zero errors (#167) - Configured Psalm (
psalm.xml.dist) with suppressions forMissingOverrideAttribute(PHP 8.3 only, project targets 8.2),PossiblyUnusedMethod/UnusedClass(library public API),PossiblyNullArrayOffset(issetis safe with null keys),PossiblyInvalidCast(Psalm cannot track the conditional$storagefield type), andRedundantCast(Psalm contradicts itself onpow()return type narrowing) (#167) - Expanded test suite from 91 to 342 tests; added test classes for
Utils\Config,Utils\Helper,Version\IncrementalItem,Version\ItemCollection,Version\TimestampedItem,Console\Color,Console\OptionStack,Console\Commands\MigrateFiles,Console\Commands\Migration,Generator\Snippet, allExceptionclasses,Observer\Profiler,Listeners\DbProfilerListener,Db\PhalconColumnBridge,Db\FieldDefinition,Db\Adapter\Mysql,Db\Adapter\Postgresql,Db\Connection,Migration\Action\Generate,Mvc\Model\Migration, andMvc\Model\Migration\TableAware\ListTablesIterator(#167) - Moved CLI entry point from project root to
bin/phalcon-migrations(#167) TimestampedItem,ListTablesDb,ListTablesIterator,Connection, andAdapterFactorynow use the customPhalcon\Migrations\Exception\InvalidArgumentExceptioninstead of the PHP built-in, giving the library a consistent exception hierarchy (#167)