migrate after docker build
Hello, I try to do something but, I don't know how to do that, I use better-auth on an express api, that I dockerized and I use gitlab-ci.yml to build the image on gitlab registry, then on my server I run a docker-compose.yml that pull the image from the gitlab registry.
my probleme is that sometime, I need to make the migrations for my bdd, but, I need to do it on the runtime cause my image does not now yet the database credentials. but as I build the image I don't have the auth.ts file anymore, so run the better-auth migrate command inside my docker does not work.
can someone give me some good way to deal with that ?
thank you
1 Reply
If you have correctly updated the database type, it would generate the sql migration file which is a plain sql you can query it in the database.
Before migrating, there’s generating the schema. Use that schema sql to migrate