Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create a simplified prisma schema for Postgres database with only the tables necessary to store measurements #208

Open
mikepsinn opened this issue Sep 2, 2024 · 0 comments
Labels
enhancement New feature or request

Comments

@mikepsinn
Copy link
Contributor

We may want to update the Prisma schema of the NextJS app with the tables necessary to store measurements, variables, units, reminders, etc. instead of solely depending on the API to store this data.

Schema to Update

Here's the NextJS Prisma Postgres schema to update
https://github.com/FDA-AI/FDAi/blob/eb480b9e50318efeebd30bff6a81b984adace994/apps/nextjs/prisma/schema.prisma

Reference Table Definitions

For reference to the tables we need to add, there's a MySQL Prisma Schema and some SQL files

  1. MySQL Prisma with the measurements table and relations
    https://github.com/FDA-AI/FDAi/blob/d441d67b44f8ef14aec2784cee9ded1fffb5a3dd/apps/api-gateway/prisma/schema.prisma#L1396-L1449

The problem with that schema is that there are a lot of tables that aren't absolutely necessary and complexity to the project

  1. This folder contains the SQL files and documentation
    https://github.com/FDA-AI/FDAi/blob/6055dce1ed1efa625cfc46cde1c98763a3536e4f/apps/dfda-1/database/ddl/quantimodo_test/measurements.sql#L3-L55

Comments

It would probably be nice to have comments from those SQL files in the Prisma schema
https://www.prisma.io/docs/orm/prisma-schema/overview

Approach

You can probably paste the existing necessary tables from the SQL files into Claude and have it convert the table and its comments to a Postgres Prisma-compatible version and then paste it in
https://github.com/FDA-AI/FDAi/blob/eb480b9e50318efeebd30bff6a81b984adace994/apps/nextjs/prisma/schema.prisma

@mikepsinn mikepsinn added the enhancement New feature or request label Sep 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant