flyway-migrations
FeaturedUse when creating database migrations, schema changes, seed data, or any SQL that modifies database structure. Covers Flyway naming conventions, versioning, and safe migration patterns.
API & Backend 225 stars
37 forks Updated 6 days ago MIT
Install
Quality Score: 88/100
Stars 20%
Recency 20%
Frontmatter 20%
Documentation 15%
Issue Health 10%
License 10%
Description 5%
Skill Content
# Flyway Migrations
## Dependencies
Boot's modular starters do NOT pull Flyway in transitively — `spring-boot-starter-data-jpa`
alone means migrations silently never run. Add the Flyway starter plus your database's module:
```xml
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-flyway</artifactId>
</dependency>
<dependency>
<groupId>org.flywaydb</groupId>
<artifactId>flyway-database-postgresql</artifactId> <!-- DB-specific module is required -->
</dependency>
```
## File Naming Convention
```
src/main/resources/db/migration/
V{version}__{description}.sql ← versioned (run once)
R__{description}.sql ← repeatable (run when checksum changes)
U{version}__{description}.sql ← undo (requires Flyway Teams)
Examples:
V1__create_users_table.sql
V2__create_orders_table.sql
V2.1__add_order_status_index.sql
V3__add_customer_email_to_orders.sql
R__create_reporting_views.sql
```
Rules:
- Double underscore `__` between version and description
- Underscore `_` for spaces in description
- Sequential versions — never go back and fill gaps
- Never modify a migration that has already run in any environment
## Example Migrations
```sql
-- V1__create_users_table.sql
CREATE TABLE users (
id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
email VARCHAR(255) NOT NULL UNIQUE,
password VARCHAR(255) NOT NULL,
role VARCHAR(50) NOT NULL DEFAULT 'USER',
created_at TIMESTAMPT...
Details
- Author
- rrezartprebreza
- Repository
- rrezartprebreza/spring-boot-skills
- Created
- 4 months ago
- Last Updated
- 6 days ago
- Language
- Java
- License
- MIT
Integrates with
Similar Skills
Semantically similar based on skill content — not just same category
API & Backend Listed
database-migration
Use before changing any persisted schema — by backend-developer on a server store, by web-developer on a client or server store, and by reliability-engineer when reviewing a change that migrates data. Triggers on the first column, field, index or model change, not on the deploy.
4 Updated 1 weeks ago
vmobifystudio API & Backend Listed
database-migration-cd
当用户要求"数据库迁移 CD/Flyway 部署/数据库变更/数据库持续部署"时触发。 在 CI/CD 流水线中安全执行数据库迁移(Flyway),含回滚策略。
1 Updated 1 weeks ago
structure-projects API & Backend Listed
migration_management
Author and apply fork-specific DB schema migrations — naming, format, how to apply locally and verify.
28 Updated today
jedbjorn