alter table ezin_messages change column ip ip varchar(255); alter table ezin_articles add column accesses_count int after read_count; alter table ezin_articles add column sessions_count int after accesses_count; update ezin_articles set sessions_count = read_count; alter table ezin_sections add column accesses_count int after a_limit; alter table ezin_sections add column sessions_count int after accesses_count; alter table ezin_sections add column raw_sessions_count int after sessions_count; alter table ezin_sections add column raw_accesses_count int after sessions_count; drop table if exists ezin_counts_temp; create table ezin_counts_temp ( -- type enum('article', 'section', 'raw_section') not null, -- id int not null, type_id char(8) binary, timestamp int, -- datetime datetime, ip char(32), key type_id (type_id), key ip (ip) ); -- -- comment this out!!! -- -- update ezin_articles set sessions_count = 0, accesses_count = 0; -- update ezin_sections set sessions_count = 0, accesses_count = 0; -- update ezin_sections set raw_sessions_count = 0, raw_accesses_count = 0; -- -- TO FORCE ARTICLE AND SECTION COUNTS UPDATE update ezin_articles set sessions_count = NULL, accesses_count = NULL; update ezin_sections set sessions_count = NULL, accesses_count = NULL; update ezin_sections set raw_sessions_count = NULL, raw_accesses_count = NULL; -- -- select distinct session_id -- from neptun2.weblog_accesses_raw -- where value_id = 'ezin:ps:3,104' -- order by session_id; -- -- select distinct session_id -- from neptun2.weblog_accesses a, neptun2.weblog_values v -- where a.value_id = v.id and v.value = 'ezin:ps:3,104' -- order by session_id; --