Skip to content

Conversation

@pkuczynski
Copy link
Collaborator

@pkuczynski pkuczynski commented Sep 22, 2025

Description of change

I collected all documentation around migrations into a single guide (folder). Tried to do only minimalistic changes to the content. I would be happy to extend documentation around migrations in a separate step (I have few ideas)

I also linked (most) of the migration(s) references from other documents into this guide.

Fixes #11673

Pull-Request Checklist

  • Code is up-to-date with the master branch
  • This pull request links relevant issues as Fixes #00000
  • There are new or updated unit tests validating the change
  • Documentation has been updated to reflect this change

Summary by CodeRabbit

  • Documentation
    • Added a comprehensive Migrations guide covering why, setup, creating, generating, executing, reverting, status, faking, extra options, and build/tooling guidance (Vite/Webpack).
    • Consolidated and replaced scattered migration guidance with linked migration docs; updated CLI command references to a concise migration command list.
    • Updated site navigation and redirects to surface the new Migrations section.

@pkuczynski
Copy link
Collaborator Author

@alumni what do you think about this one?

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Sep 29, 2025

Walkthrough

Reorganizes migration content into a dedicated "Migrations" section (11 pages), removes duplicated CLI migration instructions from other docs, updates cross-references to point to the new migration pages, and adds redirects plus a "Migrations" sidebar category.

Changes

Cohort / File(s) Change Summary
New Migrations documentation
docs/docs/migrations/01-why.md, docs/docs/migrations/02-setup.md, docs/docs/migrations/03-creating.md, docs/docs/migrations/04-generating.md, docs/docs/migrations/05-executing.md, docs/docs/migrations/06-reverting.md, docs/docs/migrations/07-status.md, docs/docs/migrations/08-faking.md, docs/docs/migrations/09-api.md, docs/docs/migrations/10-extra.md, docs/docs/migrations/11-vite.md
Added 11 pages covering migration rationale, setup, manual creation, automatic generation, executing/reverting, status, faking, QueryRunner API note, extra CLI options (timestamp), and Vite guidance.
CLI docs simplified
docs/docs/advanced-topics/6-using-cli.md
Replaced the "Create a new migration" section with a consolidated "Manage migrations" section and removed detailed per-command subsections and examples.
Datasource options trimmed
docs/docs/data-source/2-data-source-options.md
Removed detailed migration-related option blocks and replaced them with consolidated references and inline links to the new migrations docs.
Cross-reference updates & FAQ edits
docs/docs/advanced-topics/3-indices.md, docs/docs/entity/5-view-entities.md, docs/docs/getting-started.md, docs/docs/help/1-faq.md
Converted plain-text migration mentions to links to the new migrations pages; expanded Webpack bundling example in FAQ and removed several Vite-specific migration snippets.
Navigation & redirects
docs/redirects.ts, docs/sidebars.ts
Updated redirects to point legacy paths to /docs/migrations and added a "Migrations" sidebar category (autogenerated from the migrations dir).

Sequence Diagram(s)

(omitted — documentation-only changes; no runtime control-flow modifications)

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

  • Areas to focus on:
    • Verify all new/updated links resolve correctly from updated docs.
    • Confirm redirects in docs/redirects.ts route legacy URLs to /docs/migrations as intended.
    • Ensure removed CLI sections are sufficiently covered by the new migration pages.
    • Review docs/docs/help/1-faq.md Webpack/Vite guidance for accuracy.

Possibly related PRs

Suggested reviewers

  • dlhck
  • gioboa
  • naorpeled

Poem

🐰 I hopped through headings, pages, and ps,

Gathered migrations under one warm tree.
Links tucked in burrows; redirects set to lead,
Now readers find schema steps with speed.
Cheers from a rabbit — docs tidy for thee.

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the main change: consolidating scattered migrations documentation into a single centralized location with proper internal linking.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 5446a8d and d809591.

📒 Files selected for processing (3)
  • docs/docs/advanced-topics/6-using-cli.md (1 hunks)
  • docs/docs/data-source/2-data-source-options.md (2 hunks)
  • docs/docs/migrations/01-why.md (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (2)
  • docs/docs/advanced-topics/6-using-cli.md
  • docs/docs/migrations/01-why.md
🧰 Additional context used
🧠 Learnings (1)
📚 Learning: 2025-07-27T20:50:10.364Z
Learnt from: alumni
Repo: typeorm/typeorm PR: 11581
File: docs/docs/drivers/postgres.md:23-23
Timestamp: 2025-07-27T20:50:10.364Z
Learning: The correct data source type for Aurora PostgreSQL in TypeORM is `aurora-postgres`, not `aurora-data-api-pg`. The `aurora-data-api-pg` driver was renamed to `aurora-postgres` according to the CHANGELOG.md. This is defined in the DatabaseType union type and AuroraPostgresConnectionOptions interface.

Applied to files:

  • docs/docs/data-source/2-data-source-options.md
🔇 Additional comments (2)
docs/docs/data-source/2-data-source-options.md (2)

64-70: Verify migration option link targets match semantically.

Lines 64–70 consolidate migration options into minimal one-liners with references. All four options currently link to ../migrations/01-why.md (the introductory "Why migrations?" page). Consider whether more specific targets would be appropriate:

  • migrations and migrationsTableName fit the "why" introduction.
  • migrationsRun and migrationsTransactionMode involve configuration/execution and may be better served by linking to a setup or usage guide (e.g., 02-setup.md or a dedicated page on running migrations).

Confirm these links are semantically correct for each option's context and that users will find the necessary information without excessive navigation.


64-70: Approve consolidation approach while noting trade-offs.

The simplification from detailed blocks to index-style references aligns with the PR's goal of centralizing migration documentation and adhering to DRY principles. Users interested in migration option details will follow the links to the consolidated guide. This trade-off—reduced duplication for added link navigation—is consistent with the stated PR strategy of consolidating, then improving content in follow-up PRs.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@angelxmoreno
Copy link

@coderabbitai review

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Oct 20, 2025

✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 8

🧹 Nitpick comments (2)
docs/docs/migrations/10-extra.md (1)

5-5: Clarify the timestamp format.

Consider specifying that the timestamp should be a Unix timestamp in milliseconds for better clarity, e.g., "pass the timestamp (should be a non-negative Unix timestamp in milliseconds)".

docs/docs/migrations/02-setup.md (1)

36-36: Consider hyphenating compound adjectives for consistency.

For improved readability, consider hyphenating these compound adjectives:

  • Line 36: "fine grained" → "fine-grained"
  • Line 47: "error prone" → "error-prone"
  • Lines 49, 55: "auto run" → "auto-run"

Also applies to: 47-47, 49-49, 55-55

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 925dee0 and a11d0c1.

📒 Files selected for processing (19)
  • docs/docs/advanced-topics/3-indices.md (1 hunks)
  • docs/docs/advanced-topics/6-using-cli.md (0 hunks)
  • docs/docs/data-source/2-data-source-options.md (2 hunks)
  • docs/docs/entity/5-view-entities.md (1 hunks)
  • docs/docs/getting-started.md (2 hunks)
  • docs/docs/help/1-faq.md (2 hunks)
  • docs/docs/migrations/01-why.md (1 hunks)
  • docs/docs/migrations/02-setup.md (1 hunks)
  • docs/docs/migrations/03-creating.md (1 hunks)
  • docs/docs/migrations/04-generating.md (1 hunks)
  • docs/docs/migrations/05-executing.md (1 hunks)
  • docs/docs/migrations/06-reverting.md (1 hunks)
  • docs/docs/migrations/07-status.md (1 hunks)
  • docs/docs/migrations/08-faking.md (1 hunks)
  • docs/docs/migrations/09-api.md (1 hunks)
  • docs/docs/migrations/10-extra.md (1 hunks)
  • docs/docs/migrations/11-vite.md (1 hunks)
  • docs/redirects.ts (1 hunks)
  • docs/sidebars.ts (1 hunks)
💤 Files with no reviewable changes (1)
  • docs/docs/advanced-topics/6-using-cli.md
🧰 Additional context used
🪛 LanguageTool
docs/docs/data-source/2-data-source-options.md

[grammar] ~66-~66: Use a hyphen to join words.
Context: ...(../migrations/01-why.md) should be auto run on every application launch. - `m...

(QB_NEW_EN_HYPHEN)

docs/docs/migrations/08-faking.md

[grammar] ~22-~22: Use a hyphen to join words.
Context: ...tion all` flag. If you require more fine grained transaction control, you can use...

(QB_NEW_EN_HYPHEN)

docs/docs/migrations/04-generating.md

[style] ~3-~3: As a shorter alternative for ‘able to’, consider using “can”.
Context: # Generating TypeORM is able to automatically generate migration files ...

(BE_ABLE_TO)

docs/docs/migrations/02-setup.md

[grammar] ~36-~36: Use a hyphen to join words.
Context: ...o specify exact classes to get more fine grained control: ```ts import FirstMigr...

(QB_NEW_EN_HYPHEN)


[grammar] ~47-~47: Use a hyphen to join words.
Context: ...quires more manual work and can be error prone. - migrationsRun - Indicates ...

(QB_NEW_EN_HYPHEN)


[grammar] ~49-~49: Use a hyphen to join words.
Context: ...(../migrations/01-why.md) should be auto run on every application launch. ## Opt...

(QB_NEW_EN_HYPHEN)


[grammar] ~55-~55: Use a hyphen to join words.
Context: ... Indicates if migrations should be auto run on every application launch. Default...

(QB_NEW_EN_HYPHEN)


[grammar] ~67-~67: Ensure spelling is correct
Context: ...ansaction mode when running migrations. Poossible options are: - all (default) - wra...

(QB_NEW_EN_ORTHOGRAPHY_ERROR_IDS_1)

docs/docs/migrations/11-vite.md

[style] ~5-~5: Consider a more concise word here.
Context: ...nify) which includes mangling your code in order to minimize file sizes. You have 3 option...

(IN_ORDER_TO_PREMIUM)


[grammar] ~7-~7: Ensure spelling is correct
Context: ... mitigate this. The 3 options are shown belown as diff to this basic vite.config.ts ...

(QB_NEW_EN_ORTHOGRAPHY_ERROR_IDS_1)


[grammar] ~65-~65: Use a hyphen to join words.
Context: ...lower then esbuild, but offers more fine grained control over what to minify. Add...

(QB_NEW_EN_HYPHEN)

docs/docs/help/1-faq.md

[style] ~213-~213: Consider a more concise word here.
Context: ...fault which includes mangling your code in order to minimize file sizes. This breaks the [m...

(IN_ORDER_TO_PREMIUM)

🪛 markdownlint-cli2 (0.18.1)
docs/docs/migrations/05-executing.md

9-9: Link fragments should be valid

(MD051, link-fragments)

docs/docs/migrations/11-vite.md

29-29: Heading levels should only increment by one level at a time
Expected: h2; Actual: h3

(MD001, heading-increment)

🔇 Additional comments (16)
docs/sidebars.ts (1)

38-42: LGTM!

The new Migrations category is well-placed in the sidebar hierarchy and follows the established pattern of using autogenerated items for documentation directories.

docs/docs/entity/5-view-entities.md (1)

14-14: LGTM!

The link to the migrations documentation is correctly formatted and uses the appropriate relative path.

docs/docs/advanced-topics/3-indices.md (1)

151-151: LGTM!

The migrations documentation link is correctly placed in context and properly formatted.

docs/docs/migrations/06-reverting.md (1)

1-11: LGTM!

The documentation clearly explains the reverting process. The double dash (--) before the -d flag is correct for passing arguments through npm/yarn scripts to the underlying TypeORM CLI.

docs/docs/migrations/07-status.md (1)

1-11: LGTM!

The status documentation is clear and concise. The legend explaining the [X] and [ ] markers is particularly helpful for users.

docs/docs/getting-started.md (2)

37-37: LGTM!

The migration feature now properly links to the dedicated migrations guide, making it more discoverable for users.


1198-1198: LGTM!

The extension description now includes a helpful link to the migrations documentation.

docs/docs/migrations/09-api.md (2)

1-97: LGTM!

The comprehensive migration example effectively demonstrates QueryRunner API usage with practical operations like creating tables, indexes, and foreign keys. The corresponding down method properly reverses all operations.


99-630: LGTM!

The API reference is thorough and well-organized. Each method includes clear parameter descriptions, return types, and relevant database-specific notes (e.g., MySQL vs PostgreSQL differences).

docs/docs/migrations/10-extra.md (1)

8-8: ****

The command syntax in the documentation is correct. The official TypeORM documentation confirms that both typeorm -t 1650000000000 migration:create and typeorm migration:generate -t 1650000000000 are valid, meaning the flag can be positioned either before or after the subcommand. The syntax in the file matches the documented example and requires no changes.

Likely an incorrect or invalid review comment.

docs/redirects.ts (1)

126-126: LGTM!

The redirect properly supports the migration documentation consolidation by redirecting the old path to the new location.

docs/docs/migrations/08-faking.md (1)

26-42: LGTM!

The example correctly demonstrates how to use transaction = false with PostgreSQL's CONCURRENTLY operations, which cannot run inside a transaction block.

docs/docs/migrations/03-creating.md (1)

40-56: LGTM!

The SQL syntax correctly uses PostgreSQL's RENAME COLUMN syntax. The example properly demonstrates both the up (rename title to name) and down (revert back) methods.

docs/docs/migrations/11-vite.md (1)

9-86: LGTM!

The three mitigation options are well-explained with clear configuration examples. The diff format makes it easy to understand what changes to make. Option 3 (terser) provides the best balance between file size and functionality by specifically preserving only migration class names.

docs/docs/data-source/2-data-source-options.md (1)

64-70: Consolidated migration option descriptions appropriately reference new migrations guide.

The refactoring replaces detailed descriptions of migration-related options with concise links to the centralized migrations documentation at ../migrations/01-why.md. The descriptions are now uniform and consistent across all four options (migrations, migrationsRun, migrationsTableName, migrationsTransactionMode).

Verify that the target documentation (../migrations/01-why.md) provides sufficient context for users to understand each option, especially since detailed descriptions are removed here.

docs/docs/help/1-faq.md (1)

183-211: Webpack configuration example is comprehensive and well-structured.

The expanded Webpack entry configuration (lines 187–210) is significantly improved. It now clearly demonstrates:

  • Dynamic glob-based entry generation for migration files
  • Explicit resolve.extensions configuration for TypeScript
  • Correct UMD libraryTarget for migration compatibility
  • Proper output path separation for transpiled migrations

The dual-path configuration in the data source example (lines 250–255) is an excellent best practice, showing both production (transpiled) and development (source) paths.

Verify that the UMD library target and naming strategy (lines 206–208) align with TypeORM's current migration execution model. Specifically, confirm that TypeORM migration detection and execution still works correctly with UMD-bundled files.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

🧹 Nitpick comments (3)
docs/docs/migrations/11-vite.md (1)

65-65: Use hyphenation for compound adjective.

"Fine grained" should be "fine-grained" when modifying "control".

Apply this diff:

-Vite supports using terser as minifier. Terser is slower then esbuild, but offers more fine grained control over what to minify.
+Vite supports using terser as minifier. Terser is slower then esbuild, but offers more fine-grained control over what to minify.
docs/docs/migrations/02-setup.md (1)

36-36: Use hyphens for compound adjectives.

Two compound adjectives should be hyphenated:

  • Line 36: "fine grained" → "fine-grained"
  • Line 47: "error prone" → "error-prone"

Apply this diff:

-Alternatively you could also specify exact classes to get more fine grained control:
+Alternatively you could also specify exact classes to get more fine-grained control:
-but it also requires more manual work and can be error prone.
+but it also requires more manual work and can be error-prone.

Also applies to: 47-47

docs/docusaurus.config.ts (1)

201-227: Well-structured plugin configuration with proper type safety.

The expanded configuration is comprehensive and properly typed. The multiple content selectors provide good fallback coverage for different page layouts, and the strict error handling (onRouteError: "throw") will help catch routing issues early during build.

Optional: Consider verifying whether all 7 content selectors are necessary by testing which ones are actually matching content in your documentation pages. This could simplify the configuration if some selectors are redundant.

#!/bin/bash
# Search for the CSS selectors in the generated HTML to understand which ones are present
echo "Checking documentation about contentSelectors usage in the plugin..."
@signalwire/docusaurus-plugin-llms-txt content selectors best practices
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between a11d0c1 and d460985.

⛔ Files ignored due to path filters (1)
  • package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (32)
  • .github/workflows/close-stale-issues.yml (0 hunks)
  • .github/workflows/codeql.yml (1 hunks)
  • .github/workflows/commit-validation.yml (2 hunks)
  • .github/workflows/docsearch.yml (1 hunks)
  • .github/workflows/preview.yml (1 hunks)
  • .github/workflows/publish-package.yml (1 hunks)
  • .github/workflows/tests-linux.yml (11 hunks)
  • .github/workflows/tests-windows.yml (3 hunks)
  • CONTRIBUTING.md (1 hunks)
  • docker-compose.yml (1 hunks)
  • docs/.gitignore (1 hunks)
  • docs/docs/advanced-topics/3-indices.md (3 hunks)
  • docs/docs/advanced-topics/4-listeners-and-subscribers.md (3 hunks)
  • docs/docs/guides/1-active-record-data-mapper.md (0 hunks)
  • docs/docs/help/3-decorator-reference.md (3 hunks)
  • docs/docs/migrations/02-setup.md (1 hunks)
  • docs/docs/migrations/05-executing.md (1 hunks)
  • docs/docs/migrations/09-api.md (5 hunks)
  • docs/docs/migrations/11-vite.md (1 hunks)
  • docs/docs/query-runner.md (2 hunks)
  • docs/docusaurus.config.ts (2 hunks)
  • docs/src/pages/markdown-page.md (0 hunks)
  • eslint.config.mjs (1 hunks)
  • gulpfile.ts (2 hunks)
  • package.json (3 hunks)
  • src/commands/InitCommand.ts (3 hunks)
  • src/driver/mongodb/MongoConnectionOptions.ts (1 hunks)
  • src/driver/mongodb/MongoDriver.ts (1 hunks)
  • src/driver/mongodb/typings.ts (1 hunks)
  • src/driver/postgres/PostgresDriver.ts (1 hunks)
  • test/functional/driver/MongoDriver.ts (1 hunks)
  • tsconfig.json (1 hunks)
💤 Files with no reviewable changes (3)
  • docs/docs/guides/1-active-record-data-mapper.md
  • .github/workflows/close-stale-issues.yml
  • docs/src/pages/markdown-page.md
✅ Files skipped from review due to trivial changes (7)
  • docs/.gitignore
  • docs/docs/advanced-topics/4-listeners-and-subscribers.md
  • docs/docs/query-runner.md
  • docs/docs/help/3-decorator-reference.md
  • src/driver/postgres/PostgresDriver.ts
  • src/driver/mongodb/typings.ts
  • docker-compose.yml
🚧 Files skipped from review as they are similar to previous changes (1)
  • docs/docs/advanced-topics/3-indices.md
🧰 Additional context used
🧠 Learnings (3)
📚 Learning: 2025-07-27T17:29:18.547Z
Learnt from: alumni
Repo: typeorm/typeorm PR: 11581
File: docs/docs/drivers/mongodb.md:9-13
Timestamp: 2025-07-27T17:29:18.547Z
Learning: TypeORM is compatible only with mongodb@^6, not v4 as previously suggested. The package.json file contains the authoritative peer dependency information for the MongoDB driver version compatibility.

Applied to files:

  • src/commands/InitCommand.ts
  • package.json
  • docs/docs/migrations/11-vite.md
📚 Learning: 2025-07-27T17:29:18.547Z
Learnt from: alumni
Repo: typeorm/typeorm PR: 11581
File: docs/docs/drivers/mongodb.md:9-13
Timestamp: 2025-07-27T17:29:18.547Z
Learning: TypeORM supports MongoDB driver versions "^5.8.0 || ^6.0.0" according to the peerDependencies in package.json. The v4 driver is NOT supported. Always check package.json for accurate peer dependency information.

Applied to files:

  • src/commands/InitCommand.ts
📚 Learning: 2025-08-16T18:51:14.170Z
Learnt from: alumni
Repo: typeorm/typeorm PR: 11576
File: src/data-source/DataSource.ts:542-546
Timestamp: 2025-08-16T18:51:14.170Z
Learning: When improving type safety in TypeORM's query execution chain, adding generics to the QueryRunner.query method allows for proper type propagation from DataSource.query<T> through to QueryResult<T>, eliminating the need for type casts like 'as any' and 'as T'.

Applied to files:

  • docs/docs/migrations/09-api.md
🧬 Code graph analysis (1)
test/functional/driver/MongoDriver.ts (1)
src/driver/mongodb/MongoDriver.ts (2)
  • MongoDriver (32-575)
  • connect (246-258)
🪛 LanguageTool
docs/docs/migrations/02-setup.md

[grammar] ~36-~36: Use a hyphen to join words.
Context: ...o specify exact classes to get more fine grained control: ```ts import FirstMigr...

(QB_NEW_EN_HYPHEN)


[grammar] ~47-~47: Use a hyphen to join words.
Context: ...quires more manual work and can be error prone. - migrationsRun - Indicates ...

(QB_NEW_EN_HYPHEN)

docs/docs/migrations/11-vite.md

[style] ~5-~5: Consider a more concise word here.
Context: ...nify) which includes mangling your code in order to minimize file sizes. You have 3 option...

(IN_ORDER_TO_PREMIUM)


[grammar] ~65-~65: Use a hyphen to join words.
Context: ...lower then esbuild, but offers more fine grained control over what to minify. Add...

(QB_NEW_EN_HYPHEN)

⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (20)
  • GitHub Check: tests-linux (20) / postgres (14)
  • GitHub Check: tests-linux (20) / mysql_mariadb
  • GitHub Check: tests-linux (20) / postgres (17)
  • GitHub Check: tests-linux (18) / oracle
  • GitHub Check: tests-linux (18) / sap
  • GitHub Check: tests-linux (18) / postgres (14)
  • GitHub Check: tests-linux (18) / postgres (17)
  • GitHub Check: tests-linux (20) / mssql
  • GitHub Check: tests-linux (20) / cockroachdb
  • GitHub Check: tests-linux (20) / mongodb
  • GitHub Check: tests-linux (18) / mongodb
  • GitHub Check: tests-linux (18) / sqljs
  • GitHub Check: tests-linux (18) / better-sqlite3
  • GitHub Check: tests-linux (18) / mysql_mariadb_latest
  • GitHub Check: tests-linux (18) / mssql
  • GitHub Check: tests-windows / sqljs
  • GitHub Check: tests-linux (18) / mysql_mariadb
  • GitHub Check: tests-windows / sqlite
  • GitHub Check: tests-windows / better-sqlite3
  • GitHub Check: Analyze (javascript-typescript)
🔇 Additional comments (22)
docs/docusaurus.config.ts (1)

5-5: Good addition of type safety.

The import of LLMsTXTPluginOptions and its use with the satisfies operator on line 226 provides proper type checking for the plugin configuration.

.github/workflows/docsearch.yml (1)

14-14: LGTM: Workflow action update.

The update from actions/checkout@v4 to v5 is appropriate and aligns with the v5 updates across other workflows in this PR.

.github/workflows/preview.yml (1)

18-18: LGTM: Workflow actions updated to v5.

The updates to actions/checkout@v5 and actions/setup-node@v5 are appropriate and consistent with other workflow updates in this PR.

Also applies to: 23-23

.github/workflows/tests-windows.yml (1)

14-15: LGTM: Consistent workflow action updates across all jobs.

All three Windows test jobs (better-sqlite3, sqlite, sqljs) have been consistently updated to use actions/checkout@v5 and actions/setup-node@v5.

Also applies to: 37-38, 60-61

eslint.config.mjs (1)

86-94: LGTM: Well-documented temporary rule override.

The addition of a temporary jsdoc/valid-types error rule is clearly documented with an explanation of its purpose and planned removal once all warnings are addressed.

.github/workflows/codeql.yml (1)

26-26: LGTM: Workflow action update.

The update to actions/checkout@v5 is appropriate and consistent with other workflow updates in this PR.

.github/workflows/commit-validation.yml (1)

21-22: LGTM: Consistent workflow action updates.

Both the formatting and build jobs have been consistently updated to use actions/checkout@v5 and actions/setup-node@v5.

Also applies to: 34-35

CONTRIBUTING.md (1)

21-21: LGTM: Professional security contact update.

The update to use the official maintainers email (maintainers@typeorm.io) makes the security reporting process clearer and more professional. This aligns well with the package.json author email update.

package.json (3)

16-17: LGTM: Organizational branding update.

The author change from a personal name to "TypeORM" with the organizational email maintainers@typeorm.io appropriately reflects the project's collective maintenance and aligns with the security contact update in CONTRIBUTING.md.


249-254: LGTM: Package manager enforcement added.

The devEngines configuration enforces npm as the package manager with onFail: "error". This provides clear governance for contributors and prevents inconsistencies from using different package managers.


116-116: LGTM: Dev dependency enables testing for optional driver.

Adding @google-cloud/spanner as a devDependency (while it's already an optional peer dependency) enables CI testing and development without requiring manual installation. The version ^7.21.0 is within the declared peer dependency range ^5.18.0 || ^6.0.0 || ^7.0.0.

.github/workflows/tests-linux.yml (2)

24-25: LGTM: GitHub Actions version bumps.

The upgrade from v4 to v5 for both actions/checkout and actions/setup-node across all jobs is a routine maintenance update and should be backward compatible.

Also applies to: 51-52, 81-82, 122-123, 163-164, 184-185, 205-206, 226-227, 266-267, 287-291, 314-318


46-46: Verify compatibility with MongoDB 8.

The MongoDB service image has been upgraded from mongo:5.0.31 to mongo:8, which is a major version jump. While this aligns with the docker-compose template changes in InitCommand.ts, please ensure that all tests pass successfully with MongoDB 8.

Based on learnings, TypeORM supports MongoDB driver versions "^5.8.0 || ^6.0.0". Note that the MongoDB driver version and MongoDB server version are separate concerns.

tsconfig.json (1)

17-17: LGTM: Enables JSON module imports.

Adding resolveJsonModule: true is necessary to support importing JSON files (like package.json) as modules in TypeScript, which is used in InitCommand.ts.

.github/workflows/publish-package.yml (1)

14-15: LGTM: Consistent GitHub Actions version updates.

The upgrade to v5 for both actions is consistent with the changes in tests-linux.yml and represents routine maintenance.

test/functional/driver/MongoDriver.ts (1)

62-98: LGTM: Well-structured test for proxy options.

The new test suite properly verifies that MongoDB proxy configuration options are forwarded to MongoClient.connect. The test uses appropriate stubbing with sinon and validates all four proxy-related fields.

src/driver/mongodb/MongoDriver.ts (1)

206-210: LGTM: Proxy options properly registered.

The four Socks5 proxy configuration options are correctly added to validOptionNames, which ensures they will be forwarded to the MongoDB driver via buildConnectionOptions. This aligns with the interface changes in MongoConnectionOptions.ts and is covered by the new test.

gulpfile.ts (2)

229-237: LGTM: Build-time path rewriting for package.json import.

This task correctly adjusts the package.json import path in the compiled InitCommand.js during the packaging process. Since InitCommand.ts imports from ../../package.json and files are moved during packaging, this rewrite ensures the reference remains valid in the final build output.


256-257: Proper integration into packaging sequence.

The new task is correctly integrated into the packaging sequence alongside other post-compilation cleanup tasks.

src/commands/InitCommand.ts (2)

9-9: LGTM: Dynamic dependency sourcing from package.json.

Importing package.json as a module enables dynamic resolution of dependency versions throughout the init command, eliminating hardcoded versions and ensuring consistency with the project's actual dependencies.


628-628: MongoDB image version simplified.

The docker-compose template now uses mongo:8 instead of a specific patch version, which aligns with the CI workflow changes and provides automatic minor/patch updates.

src/driver/mongodb/MongoConnectionOptions.ts (1)

306-325: LGTM: Well-documented proxy configuration options.

The four Socks5 proxy configuration properties are properly typed, documented, and follow the existing pattern in the interface. They correctly extend the public API surface for MongoDB connection options.

@pkuczynski pkuczynski changed the base branch from master to next November 8, 2025 00:53
@pkuczynski pkuczynski changed the base branch from next to master November 8, 2025 00:53
@pkuczynski pkuczynski requested a review from gioboa November 8, 2025 00:54
@coveralls
Copy link

Coverage Status

coverage: 76.433% (+0.002%) from 76.431%
when pulling d460985 on pkuczynski:docs/migrations
into 925dee0 on typeorm:master.

Copy link
Collaborator

@gioboa gioboa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks a good refactoring to me 👏
Thanks @pkuczynski

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between d460985 and a40c738.

📒 Files selected for processing (1)
  • docs/redirects.ts (1 hunks)
🧰 Additional context used
🧠 Learnings (1)
📓 Common learnings
Learnt from: alumni
Repo: typeorm/typeorm PR: 11581
File: docs/docs/drivers/mongodb.md:9-13
Timestamp: 2025-07-27T17:29:18.547Z
Learning: TypeORM is compatible only with mongodb@^6, not v4 as previously suggested. The package.json file contains the authoritative peer dependency information for the MongoDB driver version compatibility.
Learnt from: alumni
Repo: typeorm/typeorm PR: 11581
File: docs/docs/drivers/mongodb.md:9-13
Timestamp: 2025-07-27T17:29:18.547Z
Learning: TypeORM supports MongoDB driver versions "^5.8.0 || ^6.0.0" according to the peerDependencies in package.json. The v4 driver is NOT supported. Always check package.json for accurate peer dependency information.

Copy link
Collaborator

@mguida22 mguida22 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like the idea here of bringing together all of our migration docs into a single top level section.

I have a few comments I'd like to discuss before we make this change

  1. I find it very helpful when reading docs to be able to see most info on the same page so I can search and see things together. There's a few pages under 'migrations' that only have a few lines, let's see if we can organize that info together.
  2. There's a lot of helpful information on non-migration pages that this PR removes. We should keep that info in addition to linking to the migrations section of docs.
  3. There is some editing for grammar that should be done before merging. I'm happy to help with editing if you want.

Comment on lines 127 to 135
## Create a new migration

You can create a new migration using CLI:

```shell
typeorm migration:create path-to-migrations-dir/migrationName
```

Learn more about [Migrations](./1-migrations.md).
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this type of information is still useful under the cli docs.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think it is. One should learn and understand how migrations works from migrations doc. If anything this page should only list all cli commands and reference to other sections in the docs (which was my longer term plan...). I just restored it in that form, please have a look.

Worth to note, that current CLI docs are outdated/not complete and the information how to run things via cli is spread across the whole docs...

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If anything this page should only list all cli commands and reference to other sections in the docs (which was my longer term plan...)

That sounds good like a good plan, but this removed the commands from the cli docs today.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did it? I still see them. Check above your comment or in this commit: 4d40123

Comment on lines -32 to -35
It accepts both migration classes and directories from which to load.
Directories support glob patterns.
Example: `migrations: [FirstMigration, SecondMigration, "migration/*.js", "modules/**/migration/*.js"]`.
Learn more about [Migrations](../advanced-topics/1-migrations.md).
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we should keep this info in these docs, even if we duplicate some of it to the migration docs

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why would we? Similarlity to CLI docs, I think this page should only be an index linking to more detailed pages...

@pkuczynski
Copy link
Collaborator Author

  1. I find it very helpful when reading docs to be able to see most info on the same page so I can search and see things together. There's a few pages under 'migrations' that only have a few lines, let's see if we can organize that info together.

I applied SRP principle, as I typically do in programming. Long functions, classes or files are hard to read and manage. For searching we have typesens on the top, which would actually work even better when docs are split. We also have <> buttons at the bottom. And current split with left and right navigation menu is quite confusing and bad UX.

We are all a little bit different I guess and I prefer a clear split on the topics, instead of having one lengthy document...

  1. There's a lot of helpful information on non-migration pages that this PR removes. We should keep that info in addition to linking to the migrations section of docs.

I applied DRY principle like one would do when programming. Duplicated content is hard to manage. I moved everything into migrations section and link there from other places. I assumed that pages like CLI docs should be only a reference to more detailed sections.

  1. There is some editing for grammar that should be done before merging. I'm happy to help with editing if you want.

I totally agree. Current docs have often poor grammar and unclear content. My goal with this PR was only to propose how documentation could be shaped in the future (merge topics together, no repeatation, split into smaller chunks, remove "advanced topics" section, etc) as a first step and later on work on the actual content. I expected that current PR might raise some controversy, so I didn't wanted to invest into the content just yet to avoid unnecessary work.

I would propose to merge current PR as it is and raise another one with improvements in the content. Any help with that is of course very welcome!

Copy link
Collaborator

@sgarner sgarner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Couple of tiny things but otherwise this LGTM. Thanks for your effort on this @pkuczynski 💜

PS: I thought we had a way to preview docs changes, but I can't see anything being generated for this PR?

@naorpeled naorpeled merged commit b639d33 into typeorm:master Nov 9, 2025
1 check passed
@alumni
Copy link
Collaborator

alumni commented Nov 9, 2025

@pkuczynski the vite docs don't belong in migration as they are not migration specific.

@pkuczynski
Copy link
Collaborator Author

@pkuczynski the vite docs don't belong in migration as they are not migration specific.

This specific page explains how to fix migerations with Vite. Could be possibly moved somewhere else, but where?

@pkuczynski pkuczynski deleted the docs/migrations branch November 9, 2025 12:14
@mguida22
Copy link
Collaborator

  1. I find it very helpful when reading docs to be able to see most info on the same page so I can search and see things together. There's a few pages under 'migrations' that only have a few lines, let's see if we can organize that info together.

I applied SRP principle, as I typically do in programming. Long functions, classes or files are hard to read and manage. For searching we have typesens on the top, which would actually work even better when docs are split. We also have <> buttons at the bottom. And current split with left and right navigation menu is quite confusing and bad UX.

We are all a little bit different I guess and I prefer a clear split on the topics, instead of having one lengthy document...

👍 I have a slightly different preference but that makes sense to me and I can follow that pattern going forward.

  1. There's a lot of helpful information on non-migration pages that this PR removes. We should keep that info in addition to linking to the migrations section of docs.

I applied DRY principle like one would do when programming. Duplicated content is hard to manage. I moved everything into migrations section and link there from other places. I assumed that pages like CLI docs should be only a reference to more detailed sections.

Removing most duplication is ok, but it's odd that I can no longer see these commands on the CLI page. They are still CLI commands so in my opinion we should list them on the CLI page and link to migration docs for more info on using them.

There's some maintenance burden to duplicating info, but sometimes that is worth it to make it easier for users to find what they are looking for.

  1. There is some editing for grammar that should be done before merging. I'm happy to help with editing if you want.

I totally agree. Current docs have often poor grammar and unclear content. My goal with this PR was only to propose how documentation could be shaped in the future (merge topics together, no repeatation, split into smaller chunks, remove "advanced topics" section, etc) as a first step and later on work on the actual content. I expected that current PR might raise some controversy, so I didn't wanted to invest into the content just yet to avoid unnecessary work.

👍

I would propose to merge current PR as it is and raise another one with improvements in the content.

In general I agree that smaller PRs are better, but we should not make changes that are incomplete or low quality. This PR introduced errors of it's own.

It's also possible to stack PRs if we want to review changes independently.

Any help with that is of course very welcome!

Happy to help 😃

@mguida22 mguida22 mentioned this pull request Nov 10, 2025
4 tasks
ThbltLmr pushed a commit to ThbltLmr/typeorm that referenced this pull request Dec 2, 2025
* docs: collect all migrations documentation in one place

* links

* vite

* fic

* link to vite project

* Apply suggestions from code review

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>

* ai review suggestions

* docs: collect all migrations documentation in one place

* links

* vite

* fic

* link to vite project

* ai review suggestions

* Apply suggestions from code review

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>

* format

* single redirect

* fix bad merge

* auto-run

* restore cli

* add migration create

* fix postgresql syntax

---------

Co-authored-by: Giorgio Boa <35845425+gioboa@users.noreply.github.com>
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
mgohin pushed a commit to mgohin/typeorm that referenced this pull request Jan 15, 2026
* docs: collect all migrations documentation in one place

* links

* vite

* fic

* link to vite project

* Apply suggestions from code review

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>

* ai review suggestions

* docs: collect all migrations documentation in one place

* links

* vite

* fic

* link to vite project

* ai review suggestions

* Apply suggestions from code review

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>

* format

* single redirect

* fix bad merge

* auto-run

* restore cli

* add migration create

* fix postgresql syntax

---------

Co-authored-by: Giorgio Boa <35845425+gioboa@users.noreply.github.com>
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Documentation around migrations is split between two pages

8 participants