Skip to content

Commit

Permalink
Ref #14 Adicionar Status do Laudo
Browse files Browse the repository at this point in the history
  • Loading branch information
HenriqueMariano25 committed Dec 20, 2021
1 parent 29d486f commit a246e49
Show file tree
Hide file tree
Showing 3 changed files with 69 additions and 0 deletions.
30 changes: 30 additions & 0 deletions src/database/migrations/20211220122933-StatusLaudo.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
'use strict';

module.exports = {
up: async (queryInterface, Sequelize) => {
return queryInterface.createTable("StatusLaudo",{
id: {
type: Sequelize.INTEGER,
allowNull: false,
autoIncrement: true,
primaryKey: true
},
descricao:{
type: Sequelize.STRING,
allowNull:false,
},
created_at:{
type: Sequelize.DATE,
allowNull: false
},
updated_at:{
type: Sequelize.DATE,
allowNull: false
},
})
},

down: async (queryInterface, Sequelize) => {
return queryInterface.dropTable('StatusLaudo')
}
};
28 changes: 28 additions & 0 deletions src/database/seeders/20211220123946-StatusLaudo.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
'use strict';

module.exports = {
up: async (queryInterface, Sequelize) => {
return queryInterface.bulkInsert("StatusLaudo", [
{
descricao: 'Aberto',
created_at: new Date(),
updated_at: new Date()
},
{
descricao: 'Andamento',
created_at: new Date(),
updated_at: new Date()
},
{
descricao: 'Fechado',
created_at: new Date(),
updated_at: new Date()
},
]
)
},

down: async (queryInterface, Sequelize) => {
return queryInterface.bulkDelete('StatusLaudo', null, {});
}
};
11 changes: 11 additions & 0 deletions src/models/StatusLaudo.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
module.exports = (sequelize, DataTypes) => {
const StatusLaudo = sequelize.define("StatusLaudo", {
descricao: DataTypes.STRING,
},
{
freezeTableName: true,
}
)

return StatusLaudo
}

0 comments on commit a246e49

Please sign in to comment.