\set VERBOSITY terse
set client_min_messages to ERROR;

-- Reset topology_id counter
select 'seq_reset', setval('topology.topology_id_seq', 1, false);

select 't1', topology.CreateTopology('t1');
insert into t1.node(geom, containing_face) values ('POINT( 0 0)', 0);
create table t1.l1 (id serial);
select 't1.l1',
       topology.AddTopoGeometryColumn('t1', 't1', 'l1', 'g', 'POINT');
insert INTO t1.l1(g) VALUES (topology.CreateTopoGeom('t1', 1, 1, '{{1,1}}'));
select 't1.rel',* from t1.relation;

select 't2', topology.CreateTopology('t2');
insert into t2.node(geom, containing_face) values ('POINT( 0 0)', 0);
create table t2.l1 (id serial);
select 't2.l1',
       topology.AddTopoGeometryColumn('t2', 't2', 'l1', 'g', 'POINT');
insert into t2.l1(g) VALUES (topology.CreateTopoGeom('t2', 1, 1, '{{1,1}}'));
select 't2.rel',* from t2.relation;

delete from topology.layer where topology_id = 1 and layer_id = 1;
delete from topology.layer where topology_id = 2 and layer_id = 1;


select topology.DropTopology('t2');
select topology.DropTopology('t1');
