-
-
Notifications
You must be signed in to change notification settings - Fork 72
Update migrations guide #284
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
# Conflicts: # _translations/po/es/guide_start_creating-project.md.po # _translations/po/es/guide_start_databases.md.po # _translations/po/es/guide_start_hello.md.po # _translations/po/es/guide_views_template-engines.md.po # _translations/po/es/guide_views_view.md.po # _translations/po/id/guide_start_creating-project.md.po # _translations/po/id/guide_start_databases.md.po # _translations/po/id/guide_start_hello.md.po # _translations/po/id/guide_views_template-engines.md.po # _translations/po/id/guide_views_view.md.po # _translations/po/ru/guide_start_creating-project.md.po # _translations/po/ru/guide_start_databases.md.po # _translations/po/ru/guide_start_hello.md.po # _translations/po/ru/guide_views_template-engines.md.po # _translations/po/ru/guide_views_view.md.po # _translations/pot/guide_start_creating-project.md.pot # _translations/pot/guide_start_databases.md.pot # _translations/pot/guide_start_hello.md.pot # _translations/pot/guide_views_template-engines.md.pot # _translations/pot/guide_views_view.md.pot # src/es/guide/start/creating-project.md # src/id/guide/start/creating-project.md # src/ru/guide/start/creating-project.md
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR significantly expands the database migrations guide documentation across multiple languages (English, Russian, Indonesian, Spanish), transforming it from minimal documentation into a comprehensive guide based on Yii 2.0's migration documentation structure.
Key changes:
- Added extensive introductory content explaining database migration concepts and workflow
- Expanded configuration instructions with detailed examples
- Added comprehensive documentation on creating, applying, reverting, and listing migrations
- Documented migration builder methods and column types extensively
- Included sections on irreversible and transactional migrations
Reviewed changes
Copilot reviewed 16 out of 16 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| src/guide/databases/db-migrations.md | Main English guide - comprehensive expansion with detailed migration documentation |
| src/ru/guide/databases/db-migrations.md | Russian version with identical English content (awaiting translation) |
| src/id/guide/databases/db-migrations.md | Indonesian version with identical English content (awaiting translation) |
| src/es/guide/databases/db-migrations.md | Spanish version with identical English content (awaiting translation) |
| _translations/pot/*.pot | Auto-generated translation template files updated |
| _translations/po//.po | Auto-generated translation files updated |
| - smallint | ||
| - integer | ||
| - bigint | ||
| - flat |
Copilot
AI
Dec 27, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Typo in column type name: "flat" should be "float". This appears in the list of numeric column types.
| - flat | |
| - float |
| To list which migrations have been applied and which are not, you may use the following commands: | ||
|
|
||
| ``` | ||
| ./yii migrate/history # showing the last 10 applied migrations |
Copilot
AI
Dec 27, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Inconsistent command format: Line 371 uses a forward slash (migrate/history) instead of a colon like all other commands. This should be migrate:history to match the pattern used throughout the document.
| ./yii migrate/history # showing the last 10 applied migrations | |
| ./yii migrate:history # showing the last 10 applied migrations |
| > application logic such. | ||
| ## Initial configuration | ||
|
|
||
| To use migrations, install [yiisoft/db-migration](https://github.com/yiisoft/db-migration/) package: | ||
|
|
||
| ```shell | ||
| composer require yiisoft/db-migration | ||
| make composer require yiisoft/db-migration | ||
| ``` | ||
|
|
||
| ### Example usage | ||
| Create a directory to store migrations `src/Migration` right in the project root. | ||
|
|
||
| First, configure a DI container. Create `config/common/db.php` with the following content: | ||
| Add the following configuration to `config/common/params.php`: |
Copilot
AI
Dec 27, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Incomplete sentence: The sentence ends abruptly with "such" and needs completion. It should likely read "...should be kept independent of other application logic such as Active Record or entity classes."
No description provided.