Skip to content

Flyway

Medium — good to knowDatabase

ELI5 — The Vibe Check

Flyway is a migration tool that keeps track of every change you've ever made to your database schema, in order, like a meticulous diary. It runs SQL scripts numbered V1, V2, V3 and remembers which ones it's already applied. No more 'did we run that ALTER TABLE on production?'

Real Talk

Flyway is an open-source database migration tool that uses versioned SQL scripts (or Java migrations) to manage schema changes. It maintains a metadata table tracking which migrations have been applied, ensuring consistent schema state across environments. It supports most major databases and integrates with CI/CD pipelines.

Show Me The Code

-- V1__Create_users.sql
CREATE TABLE users (
  id SERIAL PRIMARY KEY,
  email TEXT NOT NULL UNIQUE
);

-- V2__Add_name_column.sql
ALTER TABLE users ADD COLUMN name TEXT;

When You'll Hear This

"Flyway applies pending migrations on deploy automatically." / "We version all schema changes through Flyway scripts."

Made with passive-aggressive love by manoga.digital. Powered by Claude.