18 days ago
Hello, we are looking for solution to get auto database update while we provide new backend changes, like new entities with new migration. Today we did deploy new version of application, backend has new migration file but postgres doesnt auto update to that migration, how we could do it? Actually we need it so hard because today to get new verions we had to delete old database so we lost data. To sum it app, we are looking for solution to this case push changes on main -> Backend is building -> Postgres database is updating
10 Replies
17 days ago
Your app is responsible for managing migrations. What database library are you using?
17 days ago
I dont have problem with migrations, just update of postgres db here. I'm using postgres db, backend is in .net
17 days ago
I'm not sure what you mean by update then. Migrations do not require Postgres to do anything on it's own.
17 days ago
Like if i change backend and create new tables then i need it on DB but, DB is still with old ones without new ones. In migrations folder on backend exist migrations with new tables but posthres on railway dont use it to do database update
17 days ago
nah, all works corectlly locally, and then after we delete old db from railway and deploy again then all is good, but we cannot lost data everytime when we do changes in db
onestyle7
nah, all works corectlly locally, and then after we delete old db from railway and deploy again then all is good, but we cannot lost data everytime when we do changes in db
17 days ago
Are you saying that every time you redeploy the database you lose the data?
17 days ago
Actually i have to delete old db from railway, than deploy again anyway it doeasynt work
17 days ago
so i will describe maybe all procces. We are doing virtual career advisor. We collect from the user some data, like work experience, education and some other stuff, in the new version we add forms with financial survey - which all works on locally db, corectly. We push changes to the develop branch and next make pull request develop -> main to deploy those changes in production. Then in logs we saw that there is problem with db
next we check Data -> "Tables" in railway and we saw there is no Table "FinancialSurvey" but this table exist in locall DB so migrations work corectly. Then we talk with Claude to find solution and it reccomend to delete old Postgres build and try to do new one - this solution work, but the problem is, we lost data from last DB (that's obvious) AND such database change/update doesn't happen automatically after adding changes to the main. If something is not clear then sory, we are just students and this is the first project we are releasing for production
Attachments