From 01cd8eaa61a57f132f394e1857aa3a357d872804 Mon Sep 17 00:00:00 2001 From: Matt S Date: Wed, 20 Nov 2024 16:29:27 -0700 Subject: [PATCH] Update Migration.php Fixes issue In v5 of the migration-cli, where you get a PHP Fatal error when running migrate down without specifying a version number. --- src/Migration.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Migration.php b/src/Migration.php index 379dd60..17d2f4c 100644 --- a/src/Migration.php +++ b/src/Migration.php @@ -395,9 +395,9 @@ public function update(?int $upVersion = null, bool $force = false): void } /** - * Run all scripts to down the database version from current version up to the specified version. + * Run all scripts to down the database version from current version down to 0 or the specified version. * - * @param int $upVersion + * @param int|null $upVersion * @param bool $force * @throws DatabaseDoesNotRegistered * @throws DatabaseIsIncompleteException @@ -405,7 +405,7 @@ public function update(?int $upVersion = null, bool $force = false): void * @throws InvalidMigrationFile * @throws OldVersionSchemaException */ - public function down(int $upVersion, bool $force = false): void + public function down(?int $upVersion = null, bool $force = false): void { $this->migrate($upVersion, -1, $force); }