Repository navigation
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #369 +/- ##
============================================
+ Coverage 97.36% 97.39% +0.03%
Complexity 373 373
============================================
Files 25 25
Lines 1176 1192 +16
============================================
+ Hits 1145 1161 +16
Misses 31 31 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
samdark
marked this pull request as draft
October 14, 2026 21:18
Copilot stopped reviewing on behalf of
samdark due to an error
October 14, 2026 21:34
There was a problem hiding this comment.
Note
Copilot was unable to run its full agentic suite in this review.
Copilot review overview
5 open findings
The markdown table uses||which will render incorrectly in many markdown parsers (it introduces… · New Indexing directly intoglob(...)[0]can produce an undefined offset (and then a… · New The conditional import + conditionalimplementspattern is duplicated across multiple templates… · New The conditional import + conditionalimplementspattern is duplicated across multiple templates… · New The conditional import + conditionalimplementspattern is duplicated across multiple templates… · New
What changed in this PR
Adds configurable transaction mode for generated migrations, including CLI overrides and documentation.
Changes:
- Added
newMigrationTransactionalconfiguration (nullable) and wired it through DI / DatabaseSet. - Added
--transaction/--no-transactionoption tomigrate:createand passed it through to templates. - Updated built-in templates, tests, and docs to support and verify transactional-mode generation.
| File | Description |
|---|---|
| tests/Support/Templates/transactionMode.php | Adds a minimal template to assert the passed transaction mode. |
| tests/Support/Helper/ContainerHelper.php | Passes newMigrationTransactional into CreateService in test container wiring. |
| tests/Support/Helper/ContainerConfig.php | Adds newMigrationTransactional test configuration knob. |
| tests/Migration/ConfigTest.php | Adds config-level coverage for default vs per-db transactional mode. |
| tests/Migration/BinTest.php | Adds CLI-level coverage for --transaction/--no-transaction. |
| tests/Driver/Sqlite/DatabaseCommandsTest.php | Adds coverage for named database set transaction mode and CLI overrides. |
| tests/Driver/Sqlite/CreateCommandTest.php | Adds sqlite-level tests for defaults, config, and overrides; ensures overrides don’t leak. |
| tests/Common/Service/Generate/AbstractCreateServiceTest.php | Adds generator/service-level matrix tests across commands and modes. |
| src/Service/Generate/CreateService.php | Adds configured default transactional mode + per-run override passed into templates. |
| src/DatabaseSetRegistry.php | Wires database-set transactional config into created CreateService. |
| src/DatabaseSet.php | Adds newMigrationTransactional to database set configuration. |
| src/Command/CreateCommand.php | Adds --transaction/--no-transaction option and forwards it to generator. |
| resources/views/migration.php | Makes “create” template transactional behavior configurable via $transactional. |
| resources/views/dropTableMigration.php | Makes drop-table template transactional behavior configurable via $transactional. |
| resources/views/dropColumnMigration.php | Makes drop-column template transactional behavior configurable via $transactional. |
| resources/views/createTableMigration.php | Makes create-table template transactional behavior configurable via $transactional. |
| resources/views/addColumnMigration.php | Makes add-column template transactional behavior configurable via $transactional. |
| docs/guide/en/transactional-migrations.md | New guide explaining transactional migrations and configuration/overrides. |
| docs/guide/en/README.md | Adds link to new transactional migrations guide. |
| config/params.php | Introduces newMigrationTransactional parameter with default null. |
| config/di-console.php | Wires newMigrationTransactional param into CreateService via DI. |
| bin/yii-db-migration.php | Adds standalone config entry for newMigrationTransactional. |
| bin/yii-db-migration | Passes newMigrationTransactional into standalone CreateService. |
| README.md | Documents CLI flags and links to the new guide. |
| CHANGELOG.md | Notes the new transactional generation feature. |
🧠 Review effort: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
samdark
marked this pull request as ready for review
October 14, 2026 22:21
Member
|
@samdark Resolve conflicts, please |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


migrate:createhas no transaction-mode override, and its templates have different defaults. Add--transaction/--no-transactionand a nullablenewMigrationTransactionalsetting for Yii Console, standalone usage, and named databases. CLI overrides take precedence over configuration; omitting both preserves each template's existing behavior.Update all built-in templates and expose the resolved nullable mode to custom templates. Document configuration, precedence, and custom-template behavior.
Fixes #367.