Skip to content

Commit e20ef82

Browse files
Add requirements for using Flyway (#4367)
* Add requirements for using Flyway * Address AI and vale comments * Remove sections about postgresql dependency * Add links to the existing Flyway docs page
1 parent f5f57f9 commit e20ef82

File tree

2 files changed

+13
-26
lines changed

2 files changed

+13
-26
lines changed

articles/control-center/database/flyway-migrations.adoc

Lines changed: 11 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ Control Center provides a simple way to set up Flyway migrations to initialize y
1414

1515
== Control Center Starter
1616

17-
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.
17+
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.
1818

1919
.pom.xml
2020
[source,xml]
@@ -23,31 +23,19 @@ Adding the Control Center Starter to your project dependencies brings in the Fly
2323
<groupId>com.vaadin</groupId>
2424
<artifactId>control-center-starter</artifactId>
2525
</dependency>
26+
<dependency>
27+
<groupId>org.flywaydb</groupId>
28+
<artifactId>flyway-database-postgresql</artifactId>
29+
<version>11.7.2</version>
30+
<scope>runtime</scope>
31+
</dependency>
2632
----
2733

28-
Once this dependency is added, any migrations you create are automatically detected and applied to your database when the application starts.
34+
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.
2935

30-
[NOTE]
31-
====
32-
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:
36+
For more information about how to setup Flyway in your application, see the <<{articles}/building-apps/forms-data/add-flyway#,Add Flyway>> page.
3337

34-
[.example]
35-
--
36-
.application.properties
37-
[source,properties]
38-
----
39-
spring.flyway.enabled=false
40-
----
41-
42-
.application.yaml
43-
[source,yaml]
44-
----
45-
spring:
46-
flyway:
47-
enabled: false
48-
----
49-
--
50-
====
38+
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.
5139

5240

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

7462
== Viewing Migration Status
7563

76-
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.
64+
You can view the status of your Flyway migrations in the Control Center UI.
7765

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

articles/control-center/database/index.adoc

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,9 @@ Control Center provides a simple way to provision a database for your Vaadin app
1414

1515
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.
1616

17+
1718
== Database Migrations
1819

1920
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.
2021

21-
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].
22-
23-
For more information about how to use Flyway migrations with Control Center, see the <<./flyway-migrations#,Flyway Migrations>> page.
22+
Control Center integrates with Flyway for managing database migrations. For more information about how to setup Flyway in your application, see the <<{articles}/building-apps/forms-data/add-flyway#,Add Flyway>> page. For more information about how to use Flyway migrations with Control Center, see the <<./flyway-migrations#,Flyway Migrations>> page.

0 commit comments

Comments
 (0)