Skip to content
Snippets Groups Projects
Commit 87a3b2f1 authored by Rafael De Lima Prado's avatar Rafael De Lima Prado
Browse files

database: Add agent_version and timestamp columns into these tables and functions

parent 61d622dd
No related branches found
No related tags found
No related merge requests found
......@@ -17,7 +17,7 @@ CREATE TABLE proinfo_inventory (
disk2_used INTEGER,
extra_hds SMALLINT DEFAULT 0 NOT NULL,
mirror_timestamp TIMESTAMP,
agent_version CHARACTER VARYING(20) NOT NULL
agent_version CHARACTER VARYING(20) NOT NULL DEFAULT '0.0.0'
);
CREATE TABLE proinfo_net_usage (
......
......@@ -23,9 +23,8 @@ BEGIN
SELECT
date_it,
f.macaddr,
f.project,
s.inep,
s.name,
t.id_point,
t.name,
c.name,
c.state,
c.region,
......@@ -35,24 +34,27 @@ BEGIN
FROM
(SELECT
max(dat_id) as max_dat_id,
f.sch_id,
f.cit_id,
f.id_tc,
f.id_city,
f.macaddr,
f.project
FROM
fact_contact f
fact_communicate f
WHERE
dat_id <= date_it
GROUP BY
f.cit_id, f.sch_id, f.macaddr, f.project) as f
f.id_city, f.id_tc, f.macaddr) as f
INNER JOIN
dim_school s
telecenter t
ON
f.sch_id = s.id
f.id_tc = t.id
INNER JOIN
dim_city c
point_pt
ON
f.cit_id = c.id;
t.id_point = pt.id
INNER JOIN
city c
ON
pt.id_city = c.id;
-- how many rows were inserted?
GET DIAGNOSTICS cur_rows := ROW_COUNT;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment