Skip to content

Instantly share code, notes, and snippets.

@zibellon
Created October 15, 2022 09:51
Show Gist options
  • Save zibellon/aead8053099409f6fcd8b279dbcc63b4 to your computer and use it in GitHub Desktop.
Save zibellon/aead8053099409f6fcd8b279dbcc63b4 to your computer and use it in GitHub Desktop.
ToDo - model
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