diff --git a/db/migrations/20250626144501_modify_borrow_reason_in_asset_management_journal.php b/db/migrations/20250626144501_modify_borrow_reason_in_asset_management_journal.php index 306b2dd10..c1e1685f3 100644 --- a/db/migrations/20250626144501_modify_borrow_reason_in_asset_management_journal.php +++ b/db/migrations/20250626144501_modify_borrow_reason_in_asset_management_journal.php @@ -10,6 +10,7 @@ final class ModifyBorrowReasonInAssetManagementJournal extends AbstractMigration */ public function up(): void { + if($this->getEnvironment() == "thetool") { $table = $this->table('AssetManagementJournal'); $table->changeColumn('borrowReason', 'text', [ 'null' => true, @@ -17,6 +18,7 @@ final class ModifyBorrowReasonInAssetManagementJournal extends AbstractMigration 'after' => 'returnDate', ]); $table->update(); + } } /** @@ -24,6 +26,7 @@ final class ModifyBorrowReasonInAssetManagementJournal extends AbstractMigration */ public function down(): void { + if($this->getEnvironment() == "thetool") { // Reverting the changes made in the up() method. // This assumes the column was NOT NULL and had no comment previously. $table = $this->table('AssetManagementJournal'); @@ -32,5 +35,6 @@ final class ModifyBorrowReasonInAssetManagementJournal extends AbstractMigration 'comment' => 'Reason for borrowing the asset', // Set comment back to empty ]); $table->update(); + } } }