Sequelize queries #234
2 changed files with 3 additions and 4 deletions
|
@ -153,10 +153,10 @@ module.exports = (sequelize, { STRING, BOOLEAN, INTEGER, TEXT, ARRAY, DECIMAL, D
|
||||||
where: {
|
where: {
|
||||||
name : channelName,
|
name : channelName,
|
||||||
claimId: {
|
claimId: {
|
||||||
[Op.like]: `${channelId}%`,
|
[sequelize.Op.like]: `${channelId}%`,
|
||||||
|
},
|
||||||
},
|
},
|
||||||
order: [['height', 'ASC']],
|
order: [['height', 'ASC']],
|
||||||
},
|
|
||||||
})
|
})
|
||||||
.then(result => {
|
.then(result => {
|
||||||
switch (result.length) {
|
switch (result.length) {
|
||||||
|
|
|
@ -250,7 +250,6 @@ module.exports = (sequelize, { STRING, BOOLEAN, INTEGER, TEXT, ARRAY, DECIMAL, D
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
// sequelize.query(`SELECT claimId FROM Claim WHERE name = '${name}' AND claimId LIKE '${shortId}%' ORDER BY height ASC LIMIT 1;`, { type: db.sequelize.QueryTypes.SELECT })
|
|
||||||
Claim.getLongClaimIdFromShortClaimId = function (name, shortId) {
|
Claim.getLongClaimIdFromShortClaimId = function (name, shortId) {
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
this
|
this
|
||||||
|
@ -258,7 +257,7 @@ module.exports = (sequelize, { STRING, BOOLEAN, INTEGER, TEXT, ARRAY, DECIMAL, D
|
||||||
where: {
|
where: {
|
||||||
name,
|
name,
|
||||||
claimId: {
|
claimId: {
|
||||||
[Op.like]: `${shortId}%`,
|
[sequelize.Op.like]: `${shortId}%`,
|
||||||
}},
|
}},
|
||||||
order: [['height', 'ASC']],
|
order: [['height', 'ASC']],
|
||||||
})
|
})
|
||||||
|
|
Loading…
Reference in a new issue