snglpi/src/models/ticketSnModel.js

44 lines
949 B
JavaScript
Raw Normal View History

2025-08-30 19:04:35 -03:00
// src/models/ticketModel.js
const { DataTypes } = require('sequelize');
const db = require('./db');
// Define the Ticket model
const Ticket = db.define('Ticket', {
id: {
type: DataTypes.STRING,
primaryKey: true,
allowNull: false,
},
short_description: {
type: DataTypes.STRING,
allowNull: false,
},
description: {
type: DataTypes.TEXT,
allowNull: true,
},
state: {
type: DataTypes.STRING,
allowNull: false,
},
priority: {
type: DataTypes.STRING,
allowNull: true,
},
created_at: {
type: DataTypes.DATE,
allowNull: false,
defaultValue: DataTypes.NOW,
},
updated_at: {
type: DataTypes.DATE,
allowNull: false,
defaultValue: DataTypes.NOW,
},
}, {
timestamps: false, // Disable automatic timestamps
});
// Export the Ticket model
module.exports = Ticket;