Commit 84ff6b8a authored by Odair M.'s avatar Odair M.

Merge branch 'development' of gitlab.c3sl.ufpr.br:ensalamento/ensalamento-back into development

parents 215f38c9 ddbcaf20
......@@ -17,6 +17,7 @@ ds.automigrate(lbTables, function(err) {
async.waterfall([
loadModelFromOldDB(old_db.get_salas, app.models.Sala, LOG_CREATE),
loadModelFromOldDB(old_db.get_blocos, app.models.Bloco, LOG_CREATE),
loadModelFromOldDB(old_db.get_Tipodesala, app.models.Tipodesala, LOG_CREATE),
criaUsuario,
criaSecretario,
criaRoles,
......@@ -69,9 +70,12 @@ function addRelationBetweenModels(model, modelRelationName,
var query = {where: {}};
query.where[relationInstance.pkey_name] = relationInstance.pkeys[0];
console.log(query)
model.findOne(query, (err,data) => {
if (err) throw err;
data[modelRelationName].add(relationInstance.pkeys[1], (err,data) => {
console.log("Data:",data)
if (err ) throw err;
if(data)
data[modelRelationName].add(relationInstance.pkeys[1], (err,data) => {
cb(err,data);
});
});
......
......@@ -102,6 +102,22 @@ var blocks = [
];
var room_types = [
{
"name": "nome"
},function(x){
return x;
},
//SELECT
" name\
",
//FROM
" room_types\
",
//SAVE FILE HAS
"Tipodesala"
];
var professors = [
......@@ -302,6 +318,7 @@ var subjects_courses_relation = [
exports.tables = [
rooms,
blocks,
room_types,
professors,
departments,
sectors,
......
This diff is collapsed.
This diff is collapsed.
......@@ -33,6 +33,12 @@
"principalId": "admin",
"permission": "ALLOW",
"property": "*"
},
{
"principalType": "ROLE",
"principalId": "comissao",
"permission": "ALLOW",
"property": "*"
}
],
"methods": {}
......
......@@ -62,7 +62,7 @@
},
"Tipodesala": {
"dataSource": "ensalamento",
"public": false
"public": true
},
"Orgao": {
"dataSource": "ensalamento",
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment