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,
dtcreation TIMESTAMP NOT NULL DEFAULT NOW(),
active INT NOT NULL,
source VARCHAR(100) NOT NULL,
FOREIGN KEY (idformsorigins) REFERENCES formsorigins (id)
);

20
db/2.wp6.create_config_tables.sql

@ -100,8 +100,8 @@ BEGIN
---------------------------------- Formulários ---------------------------------------
--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
WHERE fo.name = 'WP6.MobileApp'
RETURNING id INTO idfloodzonesform;
@ -137,8 +137,8 @@ BEGIN
--End FloodZones 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
WHERE fo.name = 'WP6.MobileApp'
RETURNING id INTO idrainform;
@ -174,8 +174,8 @@ BEGIN
--End Rain 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
WHERE fo.name = 'WP6.MobileApp'
RETURNING id INTO idpluvform;
@ -210,8 +210,8 @@ BEGIN
VALUES (DEFAULT, idpluvform, idfieldsimages, 1);
--End Pluviometer 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
WHERE fo.name = 'WP6.MobileApp'
RETURNING id INTO idriverform;
@ -247,8 +247,8 @@ BEGIN
--End River 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
WHERE fo.name = 'WP6.MobileApp'
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",
"name": "Weather forecast",
"description": "Weather forecast",
"source": ""
"source": "Climatempo"
},
{
"code": "FLOODZONES_FORM",

Loading…
Cancel
Save