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

[JITERA] Create/Update models and migrations #77

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

zrg-team
Copy link
Owner

This pull request is created by JITERA

Description

[ERD] Changes

table guideline type columns
todos Create a new file named todo.js in the /models directory. Use the user.js file as a reference for the structure and conventions used in the project. Define the Todo model with the following attributes:
  • id: integer, primary key, auto-increment
  • created_at: date, not null, default to the current date and time
  • updated_at: date, not null, default to the current date and time
    Ensure to export the Todo model and to define any necessary associations if they are mentioned in the future. | ADDED | id: integer, created_at: date, updated_at: date |

Changes
* '/models/todo.js': created
* '/migrations/1735033489808-create-todo.js': created
module.exports = (sequelize) => {
class Todo extends Model {}

Todo.init({
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The 'Todo' model currently only includes 'id', 'created_at', and 'updated_at' fields. Consider adding fields like 'title' or 'description' to make the model more functional for a todo application.

module.exports = {
up: async (queryInterface, Sequelize) => {
await queryInterface.createTable('todos', {
id: {
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider adding additional fields to the 'todos' table, such as 'title' or 'description', to ensure the table is useful for storing todo items. Currently, it only contains timestamps, which may not be sufficient for a todo application.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant