Merge pull request #446 from lbryio/427-string-based-operators

427 string based operators
This commit is contained in:
Bill Bittner 2018-05-15 09:11:52 -07:00 committed by GitHub
commit 7394758d27
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 6 additions and 3 deletions

View file

@ -158,7 +158,7 @@ module.exports = (sequelize, { STRING, BOOLEAN, INTEGER, TEXT, DECIMAL }) => {
where: { where: {
name : channelName, name : channelName,
claimId: { claimId: {
$like: `${channelClaimId}%`, [sequelize.Op.like]: `${channelClaimId}%`,
}, },
}, },
order: [['height', 'ASC']], order: [['height', 'ASC']],

View file

@ -303,7 +303,7 @@ module.exports = (sequelize, { STRING, BOOLEAN, INTEGER, TEXT, DECIMAL }) => {
where: { where: {
name, name,
claimId: { claimId: {
$like: `${shortId}%`, [sequelize.Op.like]: `${shortId}%`,
}}, }},
order: [['height', 'ASC']], order: [['height', 'ASC']],
}) })

View file

@ -15,7 +15,9 @@ const {database, username, password} = require('../../config/mysqlConfig.js');
const sequelize = new Sequelize(database, username, password, { const sequelize = new Sequelize(database, username, password, {
host : 'localhost', host : 'localhost',
dialect : 'mysql', dialect : 'mysql',
dialectOptions: {decimalNumbers: true}, dialectOptions: {
decimalNumbers: true
},
logging : false, logging : false,
pool : { pool : {
max : 5, max : 5,
@ -23,6 +25,7 @@ const sequelize = new Sequelize(database, username, password, {
idle : 10000, idle : 10000,
acquire: 10000, acquire: 10000,
}, },
operatorsAliases: false,
}); });
// establish mysql connection // establish mysql connection