-- integrating scores, modify connections object to:
-- drop ip_address (text field)
-- add addr, locidispid, latitude, longitude, countrycode, region, city
-- note, this will force logout of everyone so that the new not null columns will be populated.

DELETE FROM connections;

-- ALTER TABLE connections DROP COLUMN ip_address;

ALTER TABLE connections ADD COLUMN addr BIGINT;
ALTER TABLE connections ALTER COLUMN addr SET NOT NULL;

ALTER TABLE connections ADD COLUMN locidispid INT;
ALTER TABLE connections ALTER COLUMN locidispid SET NOT NULL;

ALTER TABLE connections ADD COLUMN latitude DOUBLE PRECISION;
ALTER TABLE connections ALTER COLUMN latitude SET NOT NULL;

ALTER TABLE connections ADD COLUMN longitude DOUBLE PRECISION;
ALTER TABLE connections ALTER COLUMN longitude SET NOT NULL;

ALTER TABLE connections ADD COLUMN countrycode CHARACTER VARYING(2);

ALTER TABLE connections ADD COLUMN region CHARACTER VARYING(2);

ALTER TABLE connections ADD COLUMN city CHARACTER VARYING(255);

CREATE INDEX connections_locidispid_ndx ON connections (locidispid);
