Separating One project to two project with one Db

Hi, I’m trying to separate my project in to two project, because one project is for webpage and another one is for mobile game.

I found out it was quite hard because I had to use the same db of it.
The two project uses the same user database and some common db stuffs.
Using same db meant using same migration so I was stuck how to separate the migrations.

When there is a change in one common db for A project, it could affect to B project so I am having a hard time how to separate the migration part.
And some migrations can get messy for example, I change something in A project in alpha common db and another one for the same alpha common db in B project, In the future there could be an rollback or something other activities and It could get really messy because I have to rewind the way I did.

Is there a way how to separate the project well?
Thank you for reading my post.

What about splitting the functionality in three projects:

  • Webpage application (unaware of DB details),
  • Mobile game application (unaware of DB details), and
  • DB library to be used by the two applications.

Migrations will only be related with the BD library project.

4 Likes

Not a bad idea, and to make it as little annoying as possible to manage, placing all of this in a monorepo would be ideal.

5 Likes