Browse Source

adding new column 'source' to forms table

master
analuizaff 3 years ago
parent
commit
d07f92a9da
  1. 1
      db/0.wpd.ddl.sql
  2. 20
      db/2.wp6.create_config_tables.sql
  3. 2
      db/wp6.sample.capabilities-api.json

1
db/0.wpd.ddl.sql

@ -39,6 +39,7 @@ CREATE TABLE IF NOT EXISTS forms
description VARCHAR(100) NOT NULL, description VARCHAR(100) NOT NULL,
dtcreation TIMESTAMP NOT NULL DEFAULT NOW(), dtcreation TIMESTAMP NOT NULL DEFAULT NOW(),
active INT NOT NULL, active INT NOT NULL,
source VARCHAR(100) NOT NULL,
FOREIGN KEY (idformsorigins) REFERENCES formsorigins (id) FOREIGN KEY (idformsorigins) REFERENCES formsorigins (id)
); );

20
db/2.wp6.create_config_tables.sql

@ -100,8 +100,8 @@ BEGIN
---------------------------------- Formulários --------------------------------------- ---------------------------------- Formulários ---------------------------------------
--Begin FloodZones Form --Begin FloodZones Form
INSERT INTO forms(idformsorigins, code, name, description, dtcreation, active)
SELECT fo.id, 'FLOODZONES_FORM', 'Flood Zones Form', 'Flood Zones Form', current_timestamp, 1
INSERT INTO forms(idformsorigins, code, name, description, dtcreation, active, source)
SELECT fo.id, 'FLOODZONES_FORM', 'Flood Zones Form', 'Flood Zones Form', current_timestamp, 1, , "citizen"
FROM formsorigins fo FROM formsorigins fo
WHERE fo.name = 'WP6.MobileApp' WHERE fo.name = 'WP6.MobileApp'
RETURNING id INTO idfloodzonesform; RETURNING id INTO idfloodzonesform;
@ -137,8 +137,8 @@ BEGIN
--End FloodZones Form --End FloodZones Form
--Begin Rain Form --Begin Rain Form
INSERT INTO forms(idformsorigins, code, name, description, dtcreation, active)
SELECT fo.id, 'RAIN_FORM', 'Rain', 'Rain zones Form', current_timestamp, 1
INSERT INTO forms(idformsorigins, code, name, description, dtcreation, active, source)
SELECT fo.id, 'RAIN_FORM', 'Rain', 'Rain zones Form', current_timestamp, 1, "citizen"
FROM formsorigins fo FROM formsorigins fo
WHERE fo.name = 'WP6.MobileApp' WHERE fo.name = 'WP6.MobileApp'
RETURNING id INTO idrainform; RETURNING id INTO idrainform;
@ -174,8 +174,8 @@ BEGIN
--End Rain Form --End Rain Form
--Begin Pluviometer Form --Begin Pluviometer Form
INSERT INTO forms(idformsorigins, code, name, description, dtcreation, active)
SELECT fo.id, 'PLUVIOMETERS_FORM', 'Pluviometers', 'Pluviometers Form', current_timestamp, 1
INSERT INTO forms(idformsorigins, code, name, description, dtcreation, active, source)
SELECT fo.id, 'PLUVIOMETERS_FORM', 'Pluviometers', 'Pluviometers Form', current_timestamp, 1, "citizen"
FROM formsorigins fo FROM formsorigins fo
WHERE fo.name = 'WP6.MobileApp' WHERE fo.name = 'WP6.MobileApp'
RETURNING id INTO idpluvform; RETURNING id INTO idpluvform;
@ -210,8 +210,8 @@ BEGIN
VALUES (DEFAULT, idpluvform, idfieldsimages, 1); VALUES (DEFAULT, idpluvform, idfieldsimages, 1);
--End Pluviometer Form --End Pluviometer Form
--Begin River Form --Begin River Form
INSERT INTO forms(idformsorigins, code, name, description, dtcreation, active)
SELECT fo.id, 'RIVERFLOOD_FORM', 'River Flood', 'River Flood Form', current_timestamp, 1
INSERT INTO forms(idformsorigins, code, name, description, dtcreation, active, source)
SELECT fo.id, 'RIVERFLOOD_FORM', 'River Flood', 'River Flood Form', current_timestamp, 1, "citizen"
FROM formsorigins fo FROM formsorigins fo
WHERE fo.name = 'WP6.MobileApp' WHERE fo.name = 'WP6.MobileApp'
RETURNING id INTO idriverform; RETURNING id INTO idriverform;
@ -247,8 +247,8 @@ BEGIN
--End River Form --End River Form
--Pluviometer Registration Form --Pluviometer Registration Form
INSERT INTO forms(idformsorigins, code, name, description, dtcreation, active)
SELECT fo.id, 'PLUVIOMETERS_REGISTRATION', 'Pluviometer registration', 'Pluviometer registration', current_timestamp, 1
INSERT INTO forms(idformsorigins, code, name, description, dtcreation, active, source)
SELECT fo.id, 'PLUVIOMETERS_REGISTRATION', 'Pluviometer registration', 'Pluviometer registration', current_timestamp, 1, "citizen"
FROM formsorigins fo FROM formsorigins fo
WHERE fo.name = 'WP6.MobileApp' WHERE fo.name = 'WP6.MobileApp'
RETURNING id INTO idpluvregsform; RETURNING id INTO idpluvregsform;

2
db/wp6.sample.capabilities-api.json

@ -20,7 +20,7 @@ https: //waterproofing.geog.uni-heidelberg.de/api/hot/capability
"code": "WEATHER_FORECAST", "code": "WEATHER_FORECAST",
"name": "Weather forecast", "name": "Weather forecast",
"description": "Weather forecast", "description": "Weather forecast",
"source": ""
"source": "Climatempo"
}, },
{ {
"code": "FLOODZONES_FORM", "code": "FLOODZONES_FORM",

Loading…
Cancel
Save