-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathSeccion.js
47 lines (36 loc) · 1.04 KB
/
Seccion.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
const Sequelize=require('sequelize');
var sequelize = new Sequelize('c9', 'adriana2828', null, {});
var models = require('../models/index.js');
var Docente=sequelize.import(__dirname+"/Docente.js");
var Materia=sequelize.import(__dirname+"/Materia.js");
module.exports = function(sequelize, DataTypes) {
return sequelize.define('seccion', {
id:{type: Sequelize.INTEGER,
primaryKey:true,
autoIncrement: true
},
codigo_tri: Sequelize.STRING,
capacidad:Sequelize.INTEGER,
disponible:Sequelize.BOOLEAN,
materiaid: {
type: Sequelize.INTEGER,
references: {
// This is a reference to another model
model: Materia,
// This is the column name of the referenced model
key: 'id',
}
},
docenteid: {
type: Sequelize.INTEGER,
references: {
// This is a reference to another model
model: Docente,
// This is the column name of the referenced model
key: 'id',
}
},
}, {
freezeTableName: true // Model tableName will be the same as the model name
});
}