Skip to content

Add requirements for using Flyway #4367

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

Open
wants to merge 3 commits into
base: latest
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 10 additions & 24 deletions articles/control-center/database/flyway-migrations.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ Control Center provides a simple way to set up Flyway migrations to initialize y

== Control Center Starter

Adding the Control Center Starter to your project dependencies brings in the Flyway dependency. This allows you to manage your database migrations easily. If you haven't already done so, add the Control Center Starter to your project.
If you haven't already done so, add the Control Center Starter to your project. You also need to ensure that you have the Flyway PostgreSQL dependency in your project.

.pom.xml
[source,xml]
Expand All @@ -23,31 +23,17 @@ Adding the Control Center Starter to your project dependencies brings in the Fly
<groupId>com.vaadin</groupId>
<artifactId>control-center-starter</artifactId>
</dependency>
<dependency>
<groupId>org.flywaydb</groupId>
<artifactId>flyway-database-postgresql</artifactId>
<version>11.7.2</version>
<scope>runtime</scope>
</dependency>
----

Once this dependency is added, any migrations you create are automatically detected and applied to your database when the application starts.

[NOTE]
====
If you want to use the Control Center Starter without Flyway migrations, you can disable them by setting the `spring.flyway.enabled` property to `false` in your `application.properties` or `application.yaml` file:

[.example]
--
.application.properties
[source,properties]
----
spring.flyway.enabled=false
----
Once these dependencies are added and the Database feature is enabled, any migrations you create are automatically detected and applied to your database when the application starts.

.application.yaml
[source,yaml]
----
spring:
flyway:
enabled: false
----
--
====
NOTE: The Database feature must be <<../database#provisioning-a-database,enabled>> in order for Flyway migrations to be applied to the Control Center-managed database. If you have not already enabled the Database feature, you can do so during the deployment of your application or for an application that is already deployed.


== Migration Files
Expand All @@ -73,7 +59,7 @@ More information about Flyway migration files can be found in the https://flyway

== Viewing Migration Status

If you have <<../database#provisioning-a-database,enabled the Database feature>>, you can view the status of your Flyway migrations in the Control Center UI.
You can view the status of your Flyway migrations in the Control Center UI.

To view the details of the applied migrations, first select the relevant application from the [guilabel]*Application Selector*, as shown in the screenshot here.

Expand Down
5 changes: 2 additions & 3 deletions articles/control-center/database/index.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,9 @@ Control Center provides a simple way to provision a database for your Vaadin app

You can enable the Database feature either during the deployment of your application or for an application that is already deployed. When enabled, Control Center automatically provisions a dedicated PostgreSQL database exclusively for that application. If your application is configured to use a Spring datasource, the necessary connection details are set up automatically.


== Database Migrations

A database migration is a process that manages incremental, reversible changes to a database schema over time. Migrations allow you to evolve your database structure safely and predictably, ensuring that your application and its data remain consistent as requirements change.

Control Center integrates with Flyway for managing database migrations. When you enable the Database feature, Control Center automatically detects and applies Flyway migration scripts to the newly provisioned database. This ensures that your database schema is always up to date with your application's requirements. For more information about Flyway migrations, see the https://flywaydb.org/documentation/[Flyway documentation].

For more information about how to use Flyway migrations with Control Center, see the <<./flyway-migrations#,Flyway Migrations>> page.
Control Center integrates with Flyway for managing database migrations. For more information about how to use Flyway migrations with Control Center, see the <<./flyway-migrations#,Flyway Migrations>> page.