Watts-Lab / commonsense-platform

Commonsense platform
https://commonsense.seas.upenn.edu
1 stars 0 forks source link

New model design #156

Open amirrr opened 3 months ago

amirrr commented 3 months ago

We want to move to a new database design or perhaps even a new database ORM, as our current version — sequilize — is blocking us from comfortably migrating the backend to typescript. Our database models should be fluent and should propagate to the front-end so we would have one source of truth.

It would be nice to have our database models be built from a typescript/javascript object which we can easily use for type referring on the front-end. Prisma seems like a good alternative but it requires us to change all the database calls. So for now just having the models built from javascript objects is a good addition which we can build on in the future.

Acceptance criteria:

  1. All the database models under server/models should be built from a typescript/javascript object.
  2. All the database call should work as before without any problem.

Nice to have

  1. We should be able to have migration scripts for when we want to change our design through those files
  2. Add a migration command to our package.json for such cases