fairdataihub / codefair-app

Your coding assistant to make research software reusable without breaking a sweat!
https://codefair.io
MIT License
7 stars 2 forks source link

Prisma transfer #67

Closed slugb0t closed 2 months ago

slugb0t commented 2 months ago

Summary by Sourcery

Migrate the database layer from MongoDB to Prisma, including updating all database operations to use Prisma's API. Add a script to facilitate data transfer from MongoDB to a PostgreSQL database.

New Features:

Enhancements:

Chores:

fairdataihub-bot[bot] commented 2 months ago

Thank you for submitting this pull request! We appreciate your contribution to the project. Before we can merge it, we need to review the changes you've made to ensure they align with our code standards and meet the requirements of the project. We'll get back to you as soon as we can with feedback. Thanks again!

sourcery-ai[bot] commented 2 months ago

Reviewer's Guide by Sourcery

This pull request implements a significant change in the database technology used in the project, transitioning from MongoDB to Prisma ORM with a PostgreSQL backend. The changes involve updating database queries, data models, and connection handling across multiple files in the bot directory.

File-Level Changes

Change Details Files
Transition from MongoDB to Prisma ORM with PostgreSQL
  • Replace MongoDB client initialization with Prisma client setup
  • Update database queries to use Prisma syntax
  • Modify data models to align with Prisma schema
  • Implement new error handling for database operations
  • Add scripts for data migration from MongoDB to PostgreSQL
bot/db.js
bot/index.js
bot/metadata/index.js
bot/utils/tools/index.js
bot/utils/renderer/index.js
bot/cwl/index.js
bot/license/index.js
bot/scripts/prismaM.ts
bot/transfer-postgres.js
Update data model field names and types
  • Rename fields to use snake_case instead of camelCase
  • Update date fields to use Date objects instead of timestamps
  • Modify ID fields to align with Prisma's expectations
bot/index.js
bot/metadata/index.js
bot/utils/tools/index.js
bot/utils/renderer/index.js
bot/cwl/index.js
bot/license/index.js
Implement data migration strategy
  • Create a script to transfer data from MongoDB to PostgreSQL
  • Implement data transformation logic to fit new schema
  • Add error handling and logging for migration process
bot/scripts/prismaM.ts
bot/transfer-postgres.js

Tips - Trigger a new Sourcery review by commenting `@sourcery-ai review` on the pull request. - Continue your discussion with Sourcery by replying directly to review comments. - You can change your review settings at any time by accessing your [dashboard](https://app.sourcery.ai): - Enable or disable the Sourcery-generated pull request summary or reviewer's guide; - Change the review language; - You can always [contact us](mailto:support@sourcery.ai) if you have any questions or feedback.
fairdataihub-bot[bot] commented 2 months ago

Thanks for closing this pull request! If you have any further questions, please feel free to open a new issue. We are always happy to help!

fairdataihub-bot[bot] commented 2 months ago

Thanks for making updates to your pull request. Our team will take a look and provide feedback as soon as possible. Please wait for any GitHub Actions to complete before editing your pull request. If you have any additional questions or concerns, feel free to let us know. Thank you for your contributions!