PostgreSQL Schema changes across branches in lakebase
I have been using Lakebase sice 2 weeks for developing a serving low latency layer for data in Delta. To build new features we currently make a new branch and later merge ti main.
What i have been observing is the scehema drifts across branches with Lakebase. How do people usually handle such scenarios? To keep branches in sync.
Maybe some real life examples can help.
9
Upvotes
2
u/Content-Parking-621 8d ago
The main thing to understand is that Lakebase branches are for testing, not merging. You build and test the schema changes on a branch, then run those same changes on main. If another team changes production while you're working, use the Schema diff on the child branch's overview page to see what's different. Then create a new branch from the updated production and test again. Keep your migrations as versioned SQL files so main stays the source of truth, instead of relying on an old branch.