change bounding box column name from snake case to camel case
This commit is contained in:
@@ -90,7 +90,7 @@ const getMarketAlertById = async id => {
|
||||
*/
|
||||
const findPointInsideBoundingBox = async (latLng, email, uniqueId) => {
|
||||
return await db.sequelize.query(
|
||||
`SELECT * FROM "RealEstateRequests" WHERE email = '${email}' AND "uniqueId" = '${uniqueId}' AND subscribed = true AND ST_Contains("RealEstateRequests".bounding_box, ST_GEOMFROMTEXT('POINT (${
|
||||
`SELECT * FROM "RealEstateRequests" WHERE email = '${email}' AND "uniqueId" = '${uniqueId}' AND subscribed = true AND ST_Contains("RealEstateRequests".boundingBox, ST_GEOMFROMTEXT('POINT (${
|
||||
latLng[0]
|
||||
} ${latLng[1]})'))`
|
||||
);
|
||||
|
||||
@@ -0,0 +1,19 @@
|
||||
"use strict";
|
||||
|
||||
module.exports = {
|
||||
up: (queryInterface, Sequelize) => {
|
||||
return queryInterface.renameColumn(
|
||||
"RealEstateRequests",
|
||||
"bounding_box",
|
||||
"boundingBox"
|
||||
);
|
||||
},
|
||||
|
||||
down: (queryInterface, Sequelize) => {
|
||||
return queryInterface.renameColumn(
|
||||
"RealEstateRequests",
|
||||
"boundingBox",
|
||||
"bounding_box"
|
||||
);
|
||||
}
|
||||
};
|
||||
@@ -19,8 +19,9 @@ module.exports = (sequelize, DataTypes) => {
|
||||
gardenSizeMax: DataTypes.INTEGER,
|
||||
priceMin: DataTypes.INTEGER,
|
||||
priceMax: DataTypes.INTEGER,
|
||||
bounding_box: DataTypes.GEOMETRY("POINT", 4326),
|
||||
subscribed: DataTypes.BOOLEAN
|
||||
boundingBox: DataTypes.GEOMETRY("POINT", 4326),
|
||||
subscribed: DataTypes.BOOLEAN,
|
||||
locationInput: DataTypes.STRING
|
||||
},
|
||||
{}
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user