flyway-migrations

Featured

Use 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

View on GitHub

Quality Score: 88/100

Stars 20%
78
Recency 20%
100
Frontmatter 20%
70
Documentation 15%
100
Issue Health 10%
80
License 10%
100
Description 5%
100

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