uptrace / bun

SQL-first Golang ORM
https://bun.uptrace.dev
BSD 2-Clause "Simplified" License
3.47k stars 210 forks source link

Multiple independent migrations in the same database? #914

Open ivoras opened 9 months ago

ivoras commented 9 months ago

I am setting up a microservice project where each microservice will manage its own tables, but all will connect to the same database.

Ideally, this would use Bun's migration system, but how can I ensure that there are different "sets" of migrations for the same database, if all migrations are stored in the same bun_migrations table? I see that there is an under-documented option named WithPackageName, but it doesn't seem to be even used in the Migration model?

Is what I want supported? Any alternative suggestions?