From 32c9f032ac4816414f36a68d7867f94915689420 Mon Sep 17 00:00:00 2001 From: Lucas Fernandes de Oliveira <lfo14@inf.ufpr.br> Date: Thu, 3 Aug 2017 09:27:58 -0300 Subject: [PATCH] Issue #26: Fix name pattern Signed-off-by: Lucas Fernandes de Oliveira <lfo14@inf.ufpr.br> --- database/config.ts | 2 +- database/schema.json | 60 +++++++++++++++++----------------- database/views/city.sql | 2 +- database/views/fnu.sql | 20 ++++++------ database/views/inv.sql | 4 +-- database/views/inv_changes.sql | 16 ++++----- database/views/point.sql | 12 +++---- 7 files changed, 58 insertions(+), 58 deletions(-) diff --git a/database/config.ts b/database/config.ts index 5bf471c9..e138ee60 100755 --- a/database/config.ts +++ b/database/config.ts @@ -83,7 +83,7 @@ function createView(view: View): string { let keys = []; for (let field in view.fields) { props.push("\"" + field + "\" " + typeConvertion(view.fields[field])); - keys.push(field.name); + keys.push(field); } keys.sort(); let name = "view_" + Hash.sha1(keys); diff --git a/database/schema.json b/database/schema.json index ce97f0b1..0fabaafc 100644 --- a/database/schema.json +++ b/database/schema.json @@ -3,17 +3,17 @@ "alias" : "net_usage" , "query" : "fnu.sql" , "fields" : { - "dim:contact_date" : "date", + "dim:contactDate" : "date", "dim:point" : "integer", - "dim:mac_addr" : "string", - "met:avg_download" : "integer", - "met:avg_upload" : "integer", - "met:count_countact" : "integer", - "met:last_contact" : "date", - "met:max_upload" : "integer", - "met:max_download" : "integer", - "met:sum_download" : "integer", - "met:sum_upload" : "integer" + "dim:macAddr" : "string", + "met:avg:download" : "integer", + "met:avg:upload" : "integer", + "met:count:contact" : "integer", + "met:max:contact" : "date", + "met:max:download" : "integer", + "met:max:upload" : "integer", + "met:sum:download" : "integer", + "met:sum:upload" : "integer" } } , { @@ -21,10 +21,10 @@ , "query" : "city.sql" , "fields" : { "dim:city" : "integer", - "dim:city_name" : "string", + "dim:cityName" : "string", "dim:region" : "string", "dim:state" : "string", - "met:count_city" : "integer" + "met:count:city" : "integer" } } , { @@ -33,16 +33,16 @@ , "fields" : { "dim:active" : "boolean", "dim:city" : "integer", - "dim:digital_city" : "boolean", + "dim:digitalCity" : "boolean", "dim:gesac" : "boolean", "dim:point" : "integer", - "dim:point_date" : "date", - "dim:point_name" : "string", + "dim:pointDate" : "date", + "dim:pointName" : "string", "dim:project" : "string", "dim:telecenter" : "boolean", - "met:count_point" : "integer", - "met:hired_download" : "integer", - "met:hired_upload" : "integer" + "met:count:point" : "integer", + "met:avg:hiredDownload" : "integer", + "met:avg:hiredUpload" : "integer" } } , { @@ -50,28 +50,28 @@ , "query" : "inv_changes.sql" , "fields" : { "dim:disk" : "integer", - "dim:inventory_date" : "date", - "dim:mac_addr" : "string", + "dim:inventoryDate" : "date", + "dim:macAddr" : "string", "dim:memory" : "string", - "dim:old_disk" : "string", - "dim:old_inventory_date" : "date", - "dim:old_memory" : "string", - "dim:old_os" : "string", - "dim:old_processor" : "string", + "dim:oldDisk" : "string", + "dim:oldInventoryDate" : "date", + "dim:oldMemory" : "string", + "dim:oldOs" : "string", + "dim:oldProcessor" : "string", "dim:os" : "string", "dim:point" : "integer", "dim:processor" : "string", - "met:machines" : "integer", - "met:modified_disk" : "integer", - "met:modified_memory" : "integer" + "met:count:machines" : "integer", + "met:count:modified_disk" : "integer", + "met:count:modified_memory" : "integer" } } , { "alias" : "inventory" , "query" : "inv.sql" , "fields" : { - "dim:current_inventory" : "boolean", - "dim:inventory_date" : "date", + "dim:currentInventory" : "boolean", + "dim:inventoryDate" : "date", "dim:point" : "integer" } } diff --git a/database/views/city.sql b/database/views/city.sql index 01920779..49fcd393 100644 --- a/database/views/city.sql +++ b/database/views/city.sql @@ -3,7 +3,7 @@ SELECT , name AS "dim:city_name" , region AS "dim:region" , state AS "dim:state" - , id AS "met:count_city" + , id AS "met:count:city" FROM city ; diff --git a/database/views/fnu.sql b/database/views/fnu.sql index b21ec6db..1e593f2d 100644 --- a/database/views/fnu.sql +++ b/database/views/fnu.sql @@ -1,15 +1,15 @@ SELECT - contact_date AS "dim:contact_date" + contact_date AS "dim:contactDate" , id_point AS "dim:point" - , macaddr AS "dim:mac_addr" - , down_bytes AS "met:avg_download" - , up_bytes AS "met:avg_upload" - , '1' AS "met:count_countact" - , contact_date AS "met:last_contact" - , down_bytes AS "met:max_upload" - , up_bytes AS "met:max_download" - , down_bytes AS "met:sum_download" - , up_bytes AS "met:sum_upload" + , macaddr AS "dim:macAddr" + , down_bytes AS "met:avg:download" + , up_bytes AS "met:avg:upload" + , '1'::INTEGER AS "met:count:countact" + , contact_date AS "met:max:contact" + , down_bytes AS "met:max:upload" + , up_bytes AS "met:max:download" + , down_bytes AS "met:sum:download" + , up_bytes AS "met:sum:upload" FROM fact_net_usage ; diff --git a/database/views/inv.sql b/database/views/inv.sql index 734c5bac..d97985e5 100644 --- a/database/views/inv.sql +++ b/database/views/inv.sql @@ -1,6 +1,6 @@ SELECT - is_current AS "dim:current_inventory" - , load_date AS "dim:inventory_date" + is_current AS "dim:currentInventory" + , load_date AS "dim:inventoryDate" , id_point AS "dim:point" FROM dim_inventory diff --git a/database/views/inv_changes.sql b/database/views/inv_changes.sql index 5054855f..9b03c54b 100644 --- a/database/views/inv_changes.sql +++ b/database/views/inv_changes.sql @@ -1,17 +1,17 @@ SELECT d.new_hd_size AS "dim:disk" - , d.new_date AS "dim:inventory_date" - , d.machine AS "dim:mac_addr" + , d.new_date AS "dim:inventoryDate" + , d.machine AS "dim:macAddr" , d.new_memory_size AS "dim:memory" - , d.old_hd_size AS "dim:old_disk" - , d.old_date AS "dim:old_inventory_date" - , d.old_memory_size AS"dim:old_memory" + , d.old_hd_size AS "dim:oldDisk" + , d.old_date AS "dim:oldInventoryDate" + , d.old_memory_size AS"dim:oldMemory" , d.os_distro AS "dim:os" , d.id_point AS "dim:point" , d.processor AS "dim:processor" - , '1' AS "met:machines" - , d.hd_alert AS "met:modified_disk" - , d.memory_alert AS "met:modified_memory" + , '1'::INTEGER AS "met:count:machines" + , d.hd_alert AS "met:modifiedDisk" + , d.memory_alert AS "met:modifiedMemory" FROM ( SELECT diff --git a/database/views/point.sql b/database/views/point.sql index 9b98f16c..a80da736 100644 --- a/database/views/point.sql +++ b/database/views/point.sql @@ -1,11 +1,11 @@ SELECT p.is_active AS "dim:active" , p.id_city AS "dim:city" - , p.is_digital_city AS "dim:digital_city" + , p.is_digital_city AS "dim:digitalCity" , p.is_gesac AS "dim:gesac" , p.id AS"dim:point" - , current_date AS "dim:point_date" - , a.establishment AS "dim:point_name" + , current_date AS "dim:pointDate" + , a.establishment AS "dim:pointName" , CASE WHEN (p.is_digital_city = TRUE) THEN 'DC' WHEN (p.is_telecenter = TRUE AND p.is_gesac = FALSE) THEN 'TLBR' @@ -13,9 +13,9 @@ SELECT ELSE 'GESAC' END AS"dim:project" , p.is_telecenter AS "dim:telecenter" - , '1' AS "met:count_point" - , h.hired_download AS "met:hired_download" - , h.hired_upload AS "met:hired_upload" + , '1'::INTEGER AS "met:count:point" + , h.hired_download AS "met:avg:hiredDownload" + , h.hired_upload AS "met:avg:hiredUpload" FROM point p INNER JOIN address a ON p.id = a.id_point -- GitLab