jealapera / todo-app-api

1 stars 0 forks source link

Enhance Database Schema for Users model #4

Open jealapera opened 3 months ago

jealapera commented 3 months ago

Objective:

Requirements:

Implementation:

  1. Schema Update: Enhance the Users model schema within the userModel.js file located in the /models folder using Mongoose, incorporating the mentioned requirements.
  2. Validation: Implement validation checks within the model schema to enforce business rules for the new fields.
  3. API Integration: Update API endpoints and controllers to support CRUD operations with the enhanced model schema.
  4. Testing: Conduct comprehensive testing to validate new schema functionality, including edge cases and error handling.

Documentation:

iamcubs commented 1 week ago

Hi @jealapera cc @kimmayorga , in regards with this part of the task

Migration File Creation: Enhance the Users model schema by creating a migration file. This migration file should reflect the changes needed to accommodate the new requirements. Refer to the Knex.js Setup documentation for creating migration files.

Knex.js does not support Mongo DB or No SQL Databases. It only support relational databases.

So I will skip it for now.

kimmayorga commented 1 week ago

@iamcubs Yeah, I just did some research and It supports databases like PostgreSQL, MySQL, SQLite3, and MSSQL, etc., but not Mongo DB

kimmayorga commented 1 week ago

@iamcubs further research I think mongo DB has it's own Migration Tool, can you look to this Migrate-mongo

iamcubs commented 1 week ago

Thank you on this @kimmayorga. I will try to create a migration file using this migrate-mongoose.

kimmayorga commented 1 week ago

@iamcubs let me know if I can help on anything.

jealapera commented 1 week ago

@iamcubs Thank you for bringing this up, apologies for the oversight. Please skip the creation of migration files and proceed with directly updating the model schema via Mongoose within the code. I've also updated the task description accordingly for your reference.

CC: @kimmayorga

iamcubs commented 1 week ago

Noted on this @jealapera . Thank you.