# Rollback Migrations with Flyway Community Edition: A Clever Workaround

Original title: Flyway for freeloaders, rollback implemented in Python

> Hacker News story 49437936 · language: en · submitted 2026-08-25
> Web version: https://zeli.app/story/49437936
> About this feed: https://zeli.app/llms.txt · Agent guide: https://zeli.app/skill.md

▲ 6 · by [aconcan](<https://news.ycombinator.com/user?id=aconcan>) · 💬 2
[original](<https://aconcan.io/blog/flyway-for-freeloaders/>) · [HN discussion](<https://news.ycombinator.com/item?id=49437936>)

## Summary

Flyway Community Edition lacks the `undo` command, but you can still rollback migrations by writing reverse migrations with higher version numbers and using `migrate` to apply them. This approach records the last batch of applied migrations, stages synthetic 'down' scripts, and cleans up the schema history table via an `afterMigrate.sql` callback, all within a single transaction for atomicity. It's a hacky but effective solution that avoids the paid Teams license.

## Key quote

> Basically an 'undo' expressed as `migrate`, and the database ends up back where it started.

---

## Cite

- Page: https://zeli.app/story/49437936
- Date: 2026-08-25
- Source: aconcan.io (https://aconcan.io/blog/flyway-for-freeloaders/)
- Hacker News: https://news.ycombinator.com/item?id=49437936

## Other languages

- zh: https://zeli.app/zh/story/49437936 · markdown: https://zeli.app/zh/story/49437936.md
- ja: https://zeli.app/ja/story/49437936 · markdown: https://zeli.app/ja/story/49437936.md
- ko: https://zeli.app/ko/story/49437936 · markdown: https://zeli.app/ko/story/49437936.md
- es: https://zeli.app/es/story/49437936 · markdown: https://zeli.app/es/story/49437936.md
- ru: https://zeli.app/ru/story/49437936 · markdown: https://zeli.app/ru/story/49437936.md
