From 5ac5cbee59329d5a5276f7b7f8411d568551574a Mon Sep 17 00:00:00 2001 From: ddangelorb Date: Thu, 12 Aug 2021 07:10:26 -0300 Subject: [PATCH] Organizing files --- db/{services.ddl.sql => 0.services.ddl.sql} | 0 ...s_config.sql => 1.services.sys_config.sql} | 0 db/1.sys_config.sql | 88 ------------------ db/{services.erd.pdf => wp6.erd.pdf} | Bin 4 files changed, 88 deletions(-) rename db/{services.ddl.sql => 0.services.ddl.sql} (100%) rename db/{0.services.sys_config.sql => 1.services.sys_config.sql} (100%) delete mode 100644 db/1.sys_config.sql rename db/{services.erd.pdf => wp6.erd.pdf} (100%) diff --git a/db/services.ddl.sql b/db/0.services.ddl.sql similarity index 100% rename from db/services.ddl.sql rename to db/0.services.ddl.sql diff --git a/db/0.services.sys_config.sql b/db/1.services.sys_config.sql similarity index 100% rename from db/0.services.sys_config.sql rename to db/1.services.sys_config.sql diff --git a/db/1.sys_config.sql b/db/1.sys_config.sql deleted file mode 100644 index 685d5f1..0000000 --- a/db/1.sys_config.sql +++ /dev/null @@ -1,88 +0,0 @@ -DO $$ -DECLARE -idformsoriginsinserted bigint; -idformsinserted bigint; -idfieldsinserted bigint; -BEGIN - SELECT id FROM formsorigins INTO idformsoriginsinserted WHERE name = 'WP6.MobileApp' and active = 1; - - --BEGIN FLOODZONES_FORM - INSERT INTO forms(idformsorigins, code, name, description, dtcreation, active) values (idformsoriginsinserted, "FLOODZONES_FORM", "Flood Zones", "Flood Zones Form", DateTime(), 1) - RETURNING id INTO idformsinserted; - - INSERT INTO fields(idfieldsdatatypes, name, description, fillingclue, active) - SELECT fdt.id, 'id', 'id From FloodZones Form', '', 1 FROM fieldsdatatypes fdt WHERE fdt.name = 'integer' - RETURNING id INTO idfieldsinserted; - - INSERT INTO formsfields(id, idforms, idfields, active) VALUES (DEFAULT, idformsinserted, idfieldsinserted, 1); - - INSERT INTO fields(idfieldsdatatypes, name, description, fillingclue, active) - SELECT fdt.id, 'description', 'description From FloodZones Form', '', 1 FROM fieldsdatatypes fdt WHERE fdt.name = 'text' - RETURNING id INTO idfieldsinserted; - - INSERT INTO formsfields(id, idforms, idfields, active) VALUES (DEFAULT, idformsinserted, idfieldsinserted, 1); - - INSERT INTO fields(idfieldsdatatypes, name, description, fillingclue, active) - SELECT fdt.id, 'Images', 'Images From FloodZones Form', '', 1 FROM fieldsdatatypes fdt WHERE fdt.name = 'text' - RETURNING id INTO idfieldsinserted; - - INSERT INTO formsfields(id, idforms, idfields, active) VALUES (DEFAULT, idformsinserted, idfieldsinserted, 1); - - INSERT INTO fields(idfieldsdatatypes, name, description, fillingclue, active) - SELECT fdt.id, 'Latitude', 'Latitude From FloodZones Form', '', 1 FROM fieldsdatatypes fdt WHERE fdt.name = 'real' - RETURNING id INTO idfieldsinserted; - - INSERT INTO formsfields(id, idforms, idfields, active) VALUES (DEFAULT, idformsinserted, idfieldsinserted, 1); - - INSERT INTO fields(idfieldsdatatypes, name, description, fillingclue, active) - SELECT fdt.id, 'Longitude', 'Longitude From FloodZones Form', '', 1 FROM fieldsdatatypes fdt WHERE fdt.name = 'real' - RETURNING id INTO idfieldsinserted; - - INSERT INTO formsfields(id, idforms, idfields, active) VALUES (DEFAULT, idformsinserted, idfieldsinserted, 1); - - INSERT INTO fields(idfieldsdatatypes, name, description, fillingclue, active) - SELECT fdt.id, 'Passable', 'Passable From FloodZones Form', '', 1 FROM fieldsdatatypes fdt WHERE fdt.name = 'integer' - RETURNING id INTO idfieldsinserted; - - INSERT INTO formsfields(id, idforms, idfields, active) VALUES (DEFAULT, idformsinserted, idfieldsinserted, 1); - - INSERT INTO fields(idfieldsdatatypes, name, description, fillingclue, active) - SELECT fdt.id, 'Date', 'Date From FloodZones Form', '', 1 FROM fieldsdatatypes fdt WHERE fdt.name = 'text' - RETURNING id INTO idfieldsinserted; - - INSERT INTO formsfields(id, idforms, idfields, active) VALUES (DEFAULT, idformsinserted, idfieldsinserted, 1); - - INSERT INTO fields(idfieldsdatatypes, name, description, fillingclue, active) - SELECT fdt.id, 'Time', 'Time From FloodZones Form', '', 1 FROM fieldsdatatypes fdt WHERE fdt.name = 'text' - RETURNING id INTO idfieldsinserted; - - INSERT INTO formsfields(id, idforms, idfields, active) VALUES (DEFAULT, idformsinserted, idfieldsinserted, 1); - - INSERT INTO fields(idfieldsdatatypes, name, description, fillingclue, active) - SELECT fdt.id, 'Address', 'Address From FloodZones Form', '', 1 FROM fieldsdatatypes fdt WHERE fdt.name = 'text' - RETURNING id INTO idfieldsinserted; - - INSERT INTO formsfields(id, idforms, idfields, active) VALUES (DEFAULT, idformsinserted, idfieldsinserted, 1); - --END FLOODZONES_FORM - - --BEGIN PLUVIOMETERS_FORM - INSERT INTO forms(idformsorigins, code, name, description, dtcreation, active) values (idformsoriginsinserted, "PLUVIOMETERS_FORM", "Pluviometers", "Pluviometers Form", DateTime(), 1); - --END PLUVIOMETERS_FORM - - --BEGIN RAIN_FORM - INSERT INTO forms(idformsorigins, code, name, description, dtcreation, active) values (idformsoriginsinserted, "RAIN_FORM", "Rain", "Rain zones Form", DateTime(), 1); - --END RAIN_FORM - - --BEGIN RIVERFLOOD_FORM - INSERT INTO forms(idformsorigins, code, name, description, dtcreation, active) values (idformsoriginsinserted, "RIVERFLOOD_FORM", "River Flood", "River Flood Form", DateTime(), 1); - --END RIVERFLOOD_FORM - - --BEGIN PLUVIOMETERS_REGISTRATION - INSERT INTO forms(idformsorigins, code, name, description, dtcreation, active) values (idformsoriginsinserted, "PLUVIOMETERS_REGISTRATION", "Pluviometer registration", "Pluviometer registration", DateTime(), 1); - --END PLUVIOMETERS_REGISTRATION - -END $$; - - - - diff --git a/db/services.erd.pdf b/db/wp6.erd.pdf similarity index 100% rename from db/services.erd.pdf rename to db/wp6.erd.pdf