DELETE FROM "DIANA_EG00_LINE_NETWORK" where geom IS NULL;
DELETE FROM "DIANA_EG01_LINE_NETWORK" where geom IS NULL;
DELETE FROM "DIANA_OG01_LINE_NETWORK" where geom IS NULL;
DELETE FROM "DIANA_OG02_LINE_NETWORK" where geom IS NULL;
DELETE FROM "DIANA_OG03_LINE_NETWORK" where geom IS NULL;
DELETE FROM "DIANA_OG04_LINE_NETWORK" where geom IS NULL;
DELETE FROM "DIANA_OG05_LINE_NETWORK" where geom IS NULL;
DELETE FROM "DIANA_OG06_LINE_NETWORK" where geom IS NULL;
DELETE FROM "DIANA_OG07_LINE_NETWORK" where geom IS NULL;
DELETE FROM "DIANA_OG08_LINE_NETWORK" where geom IS NULL;
DELETE FROM "DIANA_OG09_LINE_NETWORK" where geom IS NULL;
DELETE FROM "DIANA_OG10_LINE_NETWORK" where geom IS NULL;
DELETE FROM "DIANA_OG11_LINE_NETWORK" where geom IS NULL;

UPDATE "DIANA_EG00_LINE_NETWORK" SET type_id = 0 where type_id IS NULL;
UPDATE "DIANA_EG01_LINE_NETWORK" SET type_id = 0 where type_id IS NULL;
UPDATE "DIANA_OG01_LINE_NETWORK" SET type_id = 0 where type_id IS NULL;
UPDATE "DIANA_OG02_LINE_NETWORK" SET type_id = 0 where type_id IS NULL;
UPDATE "DIANA_OG03_LINE_NETWORK" SET type_id = 0 where type_id IS NULL;
UPDATE "DIANA_OG04_LINE_NETWORK" SET type_id = 0 where type_id IS NULL;
UPDATE "DIANA_OG05_LINE_NETWORK" SET type_id = 0 where type_id IS NULL;
UPDATE "DIANA_OG06_LINE_NETWORK" SET type_id = 0 where type_id IS NULL;
UPDATE "DIANA_OG07_LINE_NETWORK" SET type_id = 0 where type_id IS NULL;
UPDATE "DIANA_OG08_LINE_NETWORK" SET type_id = 0 where type_id IS NULL;
UPDATE "DIANA_OG09_LINE_NETWORK" SET type_id = 0 where type_id IS NULL;
UPDATE "DIANA_OG10_LINE_NETWORK" SET type_id = 0 where type_id IS NULL;
UPDATE "DIANA_OG11_LINE_NETWORK" SET type_id = 0 where type_id IS NULL;

-- UPDATE "DIANA_EG0_LINE_NETWORK" set id = null;
-- select * from "DIANA_EG0_LINE_NETWORK";
--
-- SELECT setval('sequence_name', 0);
-- UPDATE "DIANA_EG0_LINE_NETWORK" SET id = DEFAULT;
--
-- UPDATE "DIANA_EG0_LINE_NETWORK" a SET id = b.num from (select b.*, row_number() over () as num from "DIANA_EG00_LINE_NETWORK" b) b where b.id = a.id;
--
--
-- update cards c
--     set position = c2.seqnum
--     from (select c2.*, row_number() over () as seqnum
--           from cards c2
--          ) c2
--     where c2.pkid = c.pkid;
--
--
-- SELECT * FROM "DIANA_EG0_LINE_NETWORK" where type_id IS NULL;

