frontpage.
newsnewestaskshowjobs

Made with ♥ by @iamnishanth

Open Source @Github

fp.

Open in hackernews

We replaced traditional ORM migrations with a DAG and stopped breaking prod

https://github.com/Vswaroop04/migrion
5•vswaroop04•1h ago

Comments

vswaroop04•1h ago
If you have worked with any Object Relational Mapping tool like Drizzle, Prisma, TypeORM, Django, Rails you have probably come across this problem:

Two developers are working on branches and they both create a migration file named 004.

One of them renames their file to 005 then you merge the changes deploy them and hope that everything works out fine.

Sometimes it does work.. Sometimes a column just disappears because the migration files were run in the wrong order.

We had to deal with this problem many times, including a few times when we had to stay up late at night to fix things that we decided to think of a new way to handle migrations.

Most Object Relational Mapping tools use an numbered system for migrations. This system works fine when one developer is working on a project but it does not work well when there are multiple branches. You end up having to coordinate the migrations dealing with conflicts or worse you have to deal with issues that only show up when the project is live.

Rolling back changes is another problem. Writing rollback scripts is hard and people often skip this step or get it wrong especially when multiple changes are involved.

That is why we built Migratex.

Of using a numbered list migrations in Migratex form a directed acyclic graph, which is similar to how Git models commits.

Each migration file declares what it depends on so multiple branches can create migration files without any conflicts.

When you merge changes:

* If two migration files truly conflict, for example if they try to change the column to different types Migratex flags the problem.

* If the migration files are independent for example if they change tables or columns they merge cleanly.

You do not have to rename any files. You do not have to coordinate with anyone. You do not have to worry about deployments because of ordering issues.

Migratex also generates SQL code automatically:

* You update your Object Relational Mapping schema.

* You run the migratex generate command.

* It compares the schema to the database and generates the migration SQL code.

Migratex also generates rollback scripts alongside the migration scripts to make rollbacks safer.

The goal of Migratex is simple:

Make schema changes safe in an environment with developers, without relying on manual ordering or fragile rollbacks.

algolint•1h ago
The shift to DAG-based migrations is a natural evolution for scaling teams. Explicit dependencies solve the production drift problems that flat numbered lists fail at.

One question: how does the tool handle observability for long-running migrations (e.g. adding an index to a 10TB table)? In a DAG, if downstream nodes are waiting, do you provide status tracking for the active node, or does it assume the backend handles the lock wait state?

vswaroop04•1h ago
Right now, Migrion doesn’t do anything special here it prints which migration is running and blocks until the database finishes.

For example, if you’re adding an index on a 10TB table, you’d just see:

Applying abc123: add index...

…and it will hang there until the database completes the operation.

That said, this is mostly a database-level concern, not something a migration tool can fully abstract away.

If you’re working with large tables, you’d typically want to use:

CREATE INDEX CONCURRENTLY (Postgres)

regardless of which migration tool you’re using.

Migratex generates the SQL, but you can edit it before applying. So in practice, you’d replace:

CREATE INDEX ...

with:

CREATE INDEX CONCURRENTLY ...

in your up.sql.

That said, there are a few things we could improve here:

Show elapsed time per migration

Add a --dry-run flag to preview what would run

Add a --statement-timeout option

These are now on the roadmap.

PC Gamer Recommends RSS Readers in a 37MB Article That Just Keeps Downloading

https://stuartbreckenridge.net/2026-03-19-pc-gamer-recommends-rss-readers-in-a-37mb-article/
1•JumpCrisscross•16s ago•0 comments

The US Is Demonstrating That It Cannot Oppose China

https://phillipspobrien.substack.com/p/the-big-story-not-being-acknowledged
1•JumpCrisscross•1m ago•0 comments

Show HN: A Markdown file that turns your AI agent into an autonomous researcher

https://github.com/krzysztofdudek/ResearcherSkill
1•chrisdudek•2m ago•0 comments

Inducing Sustained Creativity and Diversity in Large Language Models

https://gking.harvard.edu/quest
1•artninja1988•2m ago•0 comments

Trump's Eye Is on Cuba

https://www.theatlantic.com/national-security/2026/03/trump-plan-cuba/686497/
1•JumpCrisscross•3m ago•0 comments

Fixing my writers block using OpenClaw

https://foxish.me/posts/writers-block-meet-openclaw/
1•anirudhrx•4m ago•0 comments

Delve Deep Dive – companies with potentially auto-generated compliance reports

https://peakmaven.com/deepdelve/
1•cleansy•5m ago•0 comments

What Young Workers Are Doing to AI-Proof Themselves

https://www.wsj.com/economy/jobs/ai-jobs-young-people-careers-14282284
2•wallflower•5m ago•0 comments

I'm 11 and trained a custom MoE LLM for $1

2•Hey1-Arthur•6m ago•0 comments

The Dirty Secret of Election Models

https://realcarlallen.substack.com/p/the-dirty-secret-of-election-models
1•NomNew•7m ago•0 comments

Half a Gigabyte of Ads

https://daringfireball.net/linked/2026/03/22/half-a-gigabyte-of-ads
1•mikestew•8m ago•0 comments

Show HN: A BOINC project where AI designs and runs experiments autonomously

https://axiom.heliex.net
4•Pyhelix•10m ago•0 comments

Show HN: AI agent for reading fast and learning new language

https://github.com/sambuild04/reading-ai-agent
1•Sampotential25•13m ago•0 comments

Readable Code Is Unreadable

https://blog.wilsonb.com/posts/2025-06-06-readable-code-is-unreadable.html
1•tosh•13m ago•0 comments

Show HN: 518K Vietnamese legal documents (1924–2026)

https://huggingface.co/datasets/th1nhng0/vietnamese-legal-documents
1•th1nhng0•14m ago•0 comments

Which Instax Camera Should You Buy? (2026)

https://www.wired.com/gallery/which-instax-camera-should-you-buy/
1•joozio•17m ago•0 comments

Best Merino Wool Clothing (2026): Base Layers, Hoodies, Jackets and More

https://www.wired.com/story/best-merino-wool-clothes/
1•joozio•21m ago•0 comments

Multi-agent chat rooms over HTTP

https://www.agentmeet.net/
3•matanrak•22m ago•0 comments

Chinese Cigarette Museum

https://www.ciggies.app/
1•bookofjoe•24m ago•0 comments

Let's See Paul Allen's SIMD CSV Parser

http://chunkofcoal.com/posts/simd-csv/
1•g0xA52A2A•24m ago•0 comments

Pcc – a C compiler in Python, powerful enough to compile Lua 5.5.0

https://github.com/jiamo/pcc
2•jiamo•24m ago•3 comments

Ga. Court Order Included AI-Hallucinated Cases from Prosecutor's Proposed Order

https://reason.com/volokh/2026/03/21/georgia-court-order-apparently-included-ai-hallucinated-case...
1•treetalker•25m ago•0 comments

Where the Sun Is the Chef: The World's Largest Solar Kitchen

https://thebrighterworld.com/detail/Where-the-Sun-is-the-Chef-The-Worlds-Largest-Solar-Kitchen/OD...
2•thunderbong•25m ago•0 comments

Palantir extends reach into British state as gets access to sensitive FCA data

https://www.theguardian.com/technology/2026/mar/22/palantir-extends-reach-into-british-state-as-i...
4•chrisjj•27m ago•0 comments

Show HN: MAGA or Not? Political alignment scores for people and companies

https://magaornot.ai
2•rcar1046•28m ago•1 comments

William Shatner turns 95, smokes cigar, revisits 'Rocket Man' and tests X Money

https://entertainment.slashdot.org/story/26/03/22/1752237/william-shatner-celebrates-95th-birthda...
4•MilnerRoute•29m ago•0 comments

FeedFare – Walk to unlock your social apps (iOS)

https://apps.apple.com/us/app/feedfare/id6758923557FeedFare
1•nickrae•29m ago•1 comments

Gh-PR-dashboard – A GitHub CLI extension for every PR that needs your attention

https://github.com/bajaj6/gh-pr-dashboard
1•rbajaj1234•33m ago•0 comments

The Curse of the Cursor

https://unsung.aresluna.org/the-curse-of-the-cursor/
2•eustoria•34m ago•0 comments

ClashMac – A Modern Proxy Tool for macOS

https://clashmac.app/
1•eustoria•36m ago•1 comments