Skip to content

Conversation

@TheBlueSky
Copy link
Contributor

Closes #1066

This PR adds the base Flyway integration and the first of several Flyway database resource integration, PostgreSQL.

PR Checklist

  • Created a feature/dev branch in your fork (vs. submitting directly from a commit on main)
  • Based off latest main branch of toolkit
  • PR doesn't include merge commits (always rebase on top of our main, if needed)
  • New integration
    • Docs are written
    • Added description of major feature to project description for NuGet package (4000 total character limit, so don't push entire description over that)
  • Tests for the changes have been added (for bug fixes / features) (if applicable)
  • Contains NO breaking changes
  • Every new API (including internal ones) has full XML docs
  • Code follows all style conventions

Other information

None.

@TheBlueSky TheBlueSky requested a review from Alirexaa as a code owner December 28, 2025 19:50
Copilot AI review requested due to automatic review settings December 28, 2025 19:50
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 a new Flyway integration for .NET Aspire, enabling database migration capabilities. Flyway is a popular database migration tool that supports multiple database systems. The integration includes the base Flyway hosting package and PostgreSQL-specific extensions as the first database implementation.

  • Adds CommunityToolkit.Aspire.Hosting.Flyway package with core Flyway resource definitions and configuration
  • Adds PostgreSQL extension methods (WithFlywayMigration and WithFlywayRepair) to the PostgreSQL.Extensions package
  • Includes comprehensive tests and four example projects demonstrating various usage scenarios

Reviewed changes

Copilot reviewed 29 out of 29 changed files in this pull request and generated 24 comments.

Show a summary per file
File Description
src/CommunityToolkit.Aspire.Hosting.Flyway/FlywayResource.cs Defines the core FlywayResource as a ContainerResource
src/CommunityToolkit.Aspire.Hosting.Flyway/FlywayResourceConfiguration.cs Configuration model for Flyway container image and migration scripts path
src/CommunityToolkit.Aspire.Hosting.Flyway/DistributedApplicationBuilderExtensions.cs Extension methods to add Flyway resources to the application builder
src/CommunityToolkit.Aspire.Hosting.Flyway/FlywayResourceBuilderExtensions.cs Extension method for telemetry opt-in configuration
src/CommunityToolkit.Aspire.Hosting.Flyway/README.md Documentation for the base Flyway integration
src/CommunityToolkit.Aspire.Hosting.Flyway/CommunityToolkit.Aspire.Hosting.Flyway.csproj Project file for the Flyway integration package
src/CommunityToolkit.Aspire.Hosting.PostgreSQL.Extensions/PostgresDatabaseResourceBuilderExtensions.cs PostgreSQL-specific extension methods for Flyway migration and repair
src/CommunityToolkit.Aspire.Hosting.PostgreSQL.Extensions/README.md Updated documentation including Flyway usage examples
src/CommunityToolkit.Aspire.Hosting.PostgreSQL.Extensions/CommunityToolkit.Aspire.Hosting.PostgreSQL.Extensions.csproj Added project reference to Flyway package
tests/CommunityToolkit.Aspire.Hosting.Flyway.Tests/* Unit tests for core Flyway functionality
tests/CommunityToolkit.Aspire.Hosting.PostgreSQL.Extensions.Tests/ResourceCreationTests.cs Tests for PostgreSQL Flyway integration
examples/flyway/* Four example projects demonstrating basic usage, container configuration, custom configuration, and repair scenarios
CommunityToolkit.Aspire.slnx Updated solution file to include new projects

@TheBlueSky TheBlueSky force-pushed the flyway branch 4 times, most recently from 35b2521 to 24ca8aa Compare December 30, 2025 20:36
@github-actions github-actions bot added the Stale label Jan 5, 2026
@github-actions github-actions bot closed this Jan 8, 2026
@aaronpowell aaronpowell removed the Stale label Jan 12, 2026
@aaronpowell aaronpowell reopened this Jan 12, 2026
Copy link
Member

@aaronpowell aaronpowell left a comment

Choose a reason for hiding this comment

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

Overall it's pretty bang on, just a small change around how the container image is defined and used to ensure consistency, and you'll need to run generate-test-list-for-workflow.sh to update the tests workflow to ensure the tests are run.

Introduces CommunityToolkit.Aspire.Hosting.Flyway, enabling Flyway as a container resource.

It includes the extension methods for adding and configuring Flyway, and it is the base for database-specific migrations integration.
Integrate Flyway database migration support into CommunityToolkit.Aspire.Hosting.PostgreSQL.Extensions.
Added four Flyway sample projects demonstrating basic usage, container configuration, custom resource configuration, and repair command.
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.

Integration for Flyway

2 participants