-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDocDpto.js
51 lines (33 loc) · 986 Bytes
/
DocDpto.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
48
49
50
const Sequelize=require('sequelize');
var sequelize = new Sequelize('c9', 'adriana2828', null, {});
var Docente=sequelize.import(__dirname+"/Docente.js");
var Departamento=sequelize.import(__dirname+"/Departamento.js");
module.exports = function(sequelize, DataTypes) {
return sequelize.define('docdpto', {
id:{type: Sequelize.INTEGER,
primaryKey:true,
autoIncrement: true
},
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',
}
},
departamentoid: {
type: Sequelize.INTEGER,
references: {
// This is a reference to another model
model: Departamento,
// This is the column name of the referenced model
key: 'id',
},
},
jefedpto:Sequelize.BOOLEAN,
}, {
freezeTableName: true // Model tableName will be the same as the model name
});
}