* VRFS-1968 - locids are now in score history

This commit is contained in:
Seth Call 2014-07-29 18:11:00 -05:00
parent 10fbf7584e
commit 027456105b
4 changed files with 13 additions and 3 deletions

View File

@ -198,4 +198,5 @@ connection_allow_null_locidispid.sql
track_user_in_scores.sql
median_aggregate.sql
current_scores_use_median.sql
current_scores_ams_index_sms_index_use_user_instrument.sql
current_scores_ams_index_sms_index_use_user_instrument.sql
locidispid_in_score_histories.sql

View File

@ -0,0 +1,5 @@
-- https://jamkazam.atlassian.net/browse/VRFS-1968
-- store both locids in score_histories
ALTER TABLE score_histories ADD COLUMN from_locidispid BIGINT NOT NULL;
ALTER TABLE score_histories ADD COLUMN to_locidispid BIGINT NOT NULL;

View File

@ -15,14 +15,15 @@ module JamRuby
result = connection.execute(
"INSERT INTO score_histories
(from_client_id, from_user_id, from_latency_tester_id, from_addr, from_isp, from_country, from_region, from_city, from_postal, from_latitude, from_longitude,
to_client_id, to_user_id, to_latency_tester_id, to_addr, to_isp, to_country, to_region, to_city, to_postal, to_latitude, to_longitude,
(from_client_id, from_user_id, from_latency_tester_id, from_addr, from_locidispid, from_isp, from_country, from_region, from_city, from_postal, from_latitude, from_longitude,
to_client_id, to_user_id, to_latency_tester_id, to_addr, to_locidispid, to_isp, to_country, to_region, to_city, to_postal, to_latitude, to_longitude,
score, score_dt, scoring_data)
SELECT
s.anodeid AS from_client_id,
s.auserid AS from_user_id,
s.alatencytestid AS from_latency_tester_id,
s.aaddr AS from_addr,
s.alocidispid AS from_locidispid,
x.company AS from_isp,
a.countrycode AS from_country,
a.region AS from_region,
@ -34,6 +35,7 @@ module JamRuby
s.buserid AS to_user_id,
s.blatencytestid AS to_latency_tester_id,
s.baddr AS to_addr,
s.blocidispid AS to_locidispid,
y.company AS to_isp,
b.countrycode AS to_country,
b.region AS to_region,

View File

@ -38,6 +38,7 @@ describe ScoreHistory do
score_history.from_user_id.should == score1.auserid
score_history.from_latency_tester_id.should == score1.alatencytestid
score_history.from_addr.should == score1.aaddr
score_history.from_locidispid.should == score1.alocidispid
score_history.from_isp.should == austin[:jamisp].jam_company.company
score_history.from_country.should == austin[:geoiplocation].countrycode
score_history.from_region.should == austin[:geoiplocation].region
@ -49,6 +50,7 @@ describe ScoreHistory do
score_history.to_user_id.should == score1.buserid
score_history.to_latency_tester_id.should == score1.blatencytestid
score_history.to_addr.should == score1.baddr
score_history.to_locidispid.should == score1.blocidispid
score_history.to_isp.should == dallas[:jamisp].jam_company.company
score_history.to_country.should == dallas[:geoiplocation].countrycode
score_history.to_region.should == dallas[:geoiplocation].region