Skip to content

feat: [#796] Add WithMigrations function#1261

Merged
hwbrzzl merged 6 commits intomasterfrom
bowen/#796
Nov 16, 2025
Merged

feat: [#796] Add WithMigrations function#1261
hwbrzzl merged 6 commits intomasterfrom
bowen/#796

Conversation

@hwbrzzl
Copy link
Contributor

@hwbrzzl hwbrzzl commented Nov 16, 2025

📑 Description

Closes goravel/goravel#796

This pull request introduces support for registering database migrations in the application setup process. It adds a new WithMigrations method to the ApplicationBuilder, updates related tests and mocks, and provides utilities for programmatically modifying code to register migrations. The changes enhance the framework's extensibility for database schema management.

image

✅ Checks

  • Added test cases for my code

@hwbrzzl hwbrzzl requested a review from a team as a code owner November 16, 2025 08:39
Copilot AI review requested due to automatic review settings November 16, 2025 08:39
@codecov
Copy link

codecov bot commented Nov 16, 2025

Codecov Report

❌ Patch coverage is 82.35294% with 15 lines in your changes missing coverage. Please review.
✅ Project coverage is 68.04%. Comparing base (953062f) to head (b52320b).
⚠️ Report is 2 commits behind head on master.

Files with missing lines Patch % Lines
packages/modify/actions.go 82.43% 7 Missing and 6 partials ⚠️
support/console/console.go 0.00% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1261      +/-   ##
==========================================
+ Coverage   67.96%   68.04%   +0.08%     
==========================================
  Files         261      261              
  Lines       15186    15271      +85     
==========================================
+ Hits        10321    10391      +70     
- Misses       4423     4432       +9     
- Partials      442      448       +6     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Contributor

Copilot AI left a 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 adds support for registering database migrations in the application setup process through a new WithMigrations method on the ApplicationBuilder. The changes enable developers to programmatically register migrations either through the bootstrap setup or the traditional kernel approach, enhancing the framework's extensibility for database schema management.

  • Introduces WithMigrations method to ApplicationBuilder for migration registration
  • Adds AddMigration utility function for programmatic code modification
  • Updates make:migration command to automatically register migrations based on setup type

Reviewed Changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
contracts/foundation/application_builder.go Adds WithMigrations method signature to the ApplicationBuilder interface
foundation/application_builder.go Implements WithMigrations method and migration registration logic in Create
foundation/application_builder_test.go Adds comprehensive test coverage for WithMigrations functionality
mocks/foundation/ApplicationBuilder.go Auto-generated mock for the new WithMigrations method
support/console/console.go Adds GetName getter method to expose migration name
database/console/migration/migrate_make_command.go Updates migration creation to support both bootstrap and kernel registration approaches
packages/modify/actions.go Implements AddMigration function and supporting utilities for AST manipulation
packages/modify/actions_test.go Adds extensive test coverage for migration registration code modification

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

hwbrzzl and others added 4 commits November 16, 2025 16:50
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

⚠️ Performance Alert ⚠️

Possible performance regression was detected for benchmark.
Benchmark result of this commit is worse than the previous benchmark result exceeding threshold 1.50.

Benchmark suite Current: 364f945 Previous: 953062f Ratio
Benchmark_Fatal 4e-7 ns/op 0 B/op 0 allocs/op 2e-7 ns/op 0 B/op 0 allocs/op 2
Benchmark_Fatal - ns/op 4e-7 ns/op 2e-7 ns/op 2

This comment was automatically generated by workflow using github-action-benchmark.

@hwbrzzl hwbrzzl merged commit 1ea5774 into master Nov 16, 2025
14 checks passed
@hwbrzzl hwbrzzl deleted the bowen/#796 branch November 16, 2025 08:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[SUB-786] Add WithMigrations function

2 participants