Created
October 15, 2022 09:51
-
-
Save zibellon/aead8053099409f6fcd8b279dbcc63b4 to your computer and use it in GitHub Desktop.
ToDo - model
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const Sequelize = require("sequelize"); | |
const { sequelizeInstance } = require(".."); | |
class ToDo extends Sequelize.Model {} | |
ToDo.init( | |
{ | |
id: { | |
type: Sequelize.DataTypes.UUID, | |
primaryKey: true, | |
// autoIncrement: true, | |
defaultValue: Sequelize.DataTypes.UUIDV4, | |
}, | |
title: { | |
type: Sequelize.STRING, | |
defaultValue: "Title", | |
}, | |
description: { | |
type: Sequelize.STRING, | |
defaultValue: "", | |
}, | |
isCompleted: { //is_completed | |
type: Sequelize.BOOLEAN, | |
defaultValue: false, | |
}, | |
}, | |
{ sequelize: sequelizeInstance, underscored: true, modelName: "todo" } | |
); | |
module.exports = ToDo; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment