Skip to content

Latest commit

 

History

History
207 lines (143 loc) · 18.9 KB

File metadata and controls

207 lines (143 loc) · 18.9 KB

[unreleased]

Added

  • Added @template-implements ArrayAccess<string, mixed> annotation to OptionStack (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, Reference value objects replacing their Phalcon\Db counterparts (#167)
  • Added Phalcon\Migrations\Db\Connection - trimmed PDO wrapper covering all database operations (#167)
  • Added Phalcon\Migrations\Db\PhalconColumnBridge for transparent backward compatibility: migration files using Phalcon\Db\Column continue to work without modification (#167)
  • Added Phalcon\Utils\Camelize to be used instead of the one from Phalcon (#167)
  • Added migration migrate-files CLI command to update existing migration files from Phalcon\Db to Phalcon\Migrations\Db namespace (#167)
  • Added tests/Fakes/ directory with MigrationFake and MigrationCommandFake test helpers; registered Phalcon\Migrations\Tests\Fakes\ PSR-4 namespace in composer.json (#167)
  • Added tests/unit/Sqlite/AdapterTest.php covering tableExists(), primary key handling, function defaults, and index listing against an in-memory SQLite database, plus current_timestamp() default tests for the Mysql and Postgresql adapters (#176)
  • Added backwards-compatibility fixtures in tests/_data/backcompat/old/ and tests/_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_BACK and createPrevClassWithMorphMethod to verify table structure is correctly restored when running migrations backwards (#167)

Fixed

  • Fixed PHPStan errors: removed dead $map property from AdapterFactory, corrected @var SplFileInfo annotation, removed @method annotations from Migration class docblock that caused method_exists() to always evaluate to true, removed redundant @var Config annotation that made an instanceof guard appear always-true (#167)
  • Fixed Psalm errors: unused $reference and $indexColumns foreach values replaced with $_, unused $description in first loop of printParameters() replaced with $_, realpath() false return handled explicitly, implicit __toString casts made explicit with (string), mixed int/float arithmetic in IncrementalItem made type-safe with (int) pow() and intermediate $multiplier variable, addMinor() string += int fixed with explicit (string)((int) $parts[0] + $number) (#167)
  • Fixed Mysql and Postgresql adapters quoting the MySQL/MariaDB-style current_timestamp() default spelling as a string literal; function-default recognition is now shared across all adapters via AbstractAdapter::isCurrentTimestampDefault(), PostgreSQL normalises the parenthesized spelling it does not accept and also applies function defaults in the modifyColumn() SET DEFAULT path (#176)
  • Fixed PhalconColumnBridge::fromPhalcon() preserving an empty-string getAfterPosition() from Phalcon\Db\Column instead of normalising it to null; this caused AFTER `` in the generated ALTER SQL when adding columns from old-format migrations (#167)
  • Fixed Sqlite::buildCreateTableSql() silently dropping primary keys declared with the generated-migration PRIMARY index convention (name PRIMARY / type PRIMARY); a table-level PRIMARY KEY clause is now emitted unless a column already renders as INTEGER PRIMARY KEY AUTOINCREMENT (#176)
  • Fixed Sqlite::listIndexes() reporting internal sqlite_autoindex_* entries, which the table morph then attempted (and failed) to drop (#176)
  • Fixed Sqlite adapter failing with near "PRIMARY": syntax error during table morph; SQLite cannot add a primary key via ALTER TABLE, so addPrimaryKey() is now a no-op consistent with the other unsupported SQLite DDL operations (#176)
  • Fixed Sqlite adapter inheriting the information_schema.tables based tableExists(), which made every migration run against SQLite fail with no such table: information_schema.tables; the existence check now queries sqlite_master (#176)
  • Fixed Sqlite adapter storing function defaults as literal strings; CURRENT_TIMESTAMP, CURRENT_TIMESTAMP(), and NOW() are now emitted as the bare CURRENT_TIMESTAMP keyword (#176)
  • Fixed morphTable() passing the original $definition array (containing unconverted Phalcon\Db\Column, Index, Reference objects) to createTable(); objects are now normalised to Phalcon\Migrations\Db\* types in-place during the column conversion loop, so old-format migration files work correctly on table creation (#167)
  • Fixed four \$this syntax errors in tests/unit/Cli/RunTest.php that prevented the test suite from loading (#167)
  • Fixed typo in Generate::checkEntityExists() error message: 'Migration entity is e,pty''Migration entity is empty' (#167)

Changed

  • Added named static constructor methods to all exception classes returning self, eliminating raw new 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 of Phalcon\Config adapters (#167)
  • Changed Observer/Profiler and Listeners/DbProfilerListener without Phalcon\Db dependency; 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 unit suite under tests/unit/ (#167)
  • Configured PHPStan at level 5 (embedded in phpstan.neon.dist); zero errors (#167)
  • Configured Psalm (psalm.xml.dist) with suppressions for MissingOverrideAttribute (PHP 8.3 only, project targets 8.2), PossiblyUnusedMethod/UnusedClass (library public API), PossiblyNullArrayOffset (isset is safe with null keys), PossiblyInvalidCast (Psalm cannot track the conditional $storage field type), and RedundantCast (Psalm contradicts itself on pow() 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, all Exception classes, Observer\Profiler, Listeners\DbProfilerListener, Db\PhalconColumnBridge, Db\FieldDefinition, Db\Adapter\Mysql, Db\Adapter\Postgresql, Db\Connection, Migration\Action\Generate, Mvc\Model\Migration, and Mvc\Model\Migration\TableAware\ListTablesIterator (#167)
  • Moved CLI entry point from project root to bin/phalcon-migrations (#167)
  • TimestampedItem, ListTablesDb, ListTablesIterator, Connection, and AdapterFactory now use the custom Phalcon\Migrations\Exception\InvalidArgumentException instead of the PHP built-in, giving the library a consistent exception hierarchy (#167)

Removed

  • Removed Phalcon\Config\Config dependency; replaced with Phalcon\Migrations\Utils\Config flat value object (#166)
  • Removed Phalcon\Db dependency entirely; replaced with library-local Phalcon\Migrations\Db layer (#166)

2.2.4 (2021-12-10)

  • Changed column modification behavior during table morph (#126)

2.2.3 (2021-08-11)

  • Changed column modification behavior during table morph (#97)
  • Updated composer packages (#124)

2.2.2 (2021-08-08)

  • Integrated nette/php-generator, changed algorithm of migrations generation (#90)

2.2.1 (2021-08-03)

  • Fixed types and indexes definition on pgsql adapter (#111, #112, #118)

2.2.0 (2021-08-03)

Supported Versions: 7.3, 7.4, 8.0

  • This release provides initial PHP 8 support.

2.1.6 (2021-03-22)

  • Fixed duplicated table phalcon_migrations in PostgreSQL (#104)
  • Fixed morphing when column attribute unsiged is changed (#109)

2.1.5 (2020-11-03)

  • Enhanced error output during failed table morph (#99)

2.1.4 (2020-08-31)

  • Fixed 'options' table definition (#94)

2.1.3 (2020-08-29)

  • Improved tests codebase (#86)
  • Fixed .phar compilation (#91)
  • Added filter for column default value (65735c1)

2.1.2 (2020-03-30)

Supported PHP versions: 7.2, 7.3, 7.4

  • Added separate changelog document CHANGELOG.md (#85)
  • Fixed long execution of data insertion during migration run (x14 faster) (#76)
  • Added README.md inside tests folder (#78)

2.1.1 (2020-03-26)

Supported PHP versions: 7.2, 7.3, 7.4

  • Added size for DECIMAL Column type (MySQL) (#77)
  • Added possibility to specify options no-auto-increment, skip-ref-schema and skip-foreign-checks from config file (#80)

2.1.0 (2020-03-22)

Supported PHP versions: 7.2, 7.3, 7.4

  • Added option to disable and enable foreign key (#11)
  • Added config option to ignore reference schema (#68)
  • Added more tests (38028e8)
  • Removed extended class of Phalcon PDO and Dialect (58c383b)

2.0.0 (2020-03-19)

  • Integrated Phalcon CLI Options Parser (COP) (#20)
  • Removed duplicated required 1st argument migration in CLI (#20)
  • Rewrote all tests from PHPUnit to Codeception, also added CLI tests (#20, 2ede70c)

1.2.2 (2020-03-18)

  • Fixed references generation (d225f61)

1.2.1 (2020-03-13)

  • Fixed running migration that were added before the latest (#66)
  • Refactored part of Migration file generation

1.2.0 (2020-03-12)

  • Disabled AUTO_INCREMENT option in migrations by default (#57)
  • Added PRIMARY KEY in table "phalcon_migrations" on column "version" (#58)
  • Implement PHAR release for each new version (#12)
  • Updated shivammathur/setup-php to v2 and add cache for extensions (5ce0c6a)

1.1.7 (2020-02-10)

  • Added support of ENUM column type (#7)

1.1.6 (2020-02-06)

  • Updated list of column types without size (#49)
  • Fixed generation table columns with NULL definition (#51)
  • Fixed running time based migrations (#53)

1.1.5 (2020-02-02)

  • Fixed adding primary key in migration generation for PostgreSQL (#1)
  • Added test cases in migrations to run SET FOREIGN_KEY_CHECKS (#2)
  • Implemented workflows for PostgreSQL with new tests (#43)
  • Added support of 'descr' option in config file (#39)
  • Fixed PHP Notice in case if migrations directory(ies) was(were) not found (#40)
  • Adapt code to PSR-12 format (#47)

1.1.4 (2020-01-29)

  • Updated Github Actions to run tests with different PHP versions: 7.2, 7.3, 7.4 (#32)
  • Updated minimum required version of Phalcon to 4.0.0 (b3e1a4a)
  • Reviewed support of MySQL JSON type (#3)
  • Fixed adding foreign key during separate migrations (#29)

1.1.3 (2020-01-01)

  • Added support of TIME datatype (#8)

1.1.2 (2019-12-30)

  • Minor refactor (c7cf72a)
  • Fixed 2 argument type in batchInsert() method (63f5b33)

1.1.1 (2019-12-21)

1.1.0 (2019-12-14)

  • Refactored Migrations class (9603ab7, 24a62fa)
  • Implemented bin for CLI usage (#13)
  • Fixed global installation of package (#15)
  • Fixed ---log-in-db parameter (#17)
  • Fixed omitting size for DATE and DATETIME types (#22)

1.0.4 (2019-11-18)

  • Fixed migrations run with 'migrationsDir' option as a string

1.0.3 (2019-11-18)

1.0.2 (2019-11-17)

  • Removed ext-posix from composer requirements

1.0.1 (2019-11-17)

  • Configured Github Actions
  • Fixed passing third parameter to generateAll() method
  • Refactored current Tests
  • Implemented new Tests
  • Enabled Codecov.io reports
  • Small refactors in code
  • Moved Phinx composer package to suggestions
  • Bumped minimal Phalcon version to 4.0.0-RC.3

1.0.0 (2019-10-31)

  • First release, separated from devtools