 \set log_error_verbosity terse
+insert into catalogue_levels (id, level_type, level_name, level_sys_name, optional_level) values (0, 'all', '-', '-', false);
 insert into catalogue_levels (id, level_type, level_name, level_sys_name, optional_level) values (1, 'taxonomy', 'domain', 'domain', false);
 insert into catalogue_levels (id, level_type, level_name, level_sys_name, optional_level) values (2, 'taxonomy', 'kingdom', 'kingdom', false);
 insert into catalogue_levels (id, level_type, level_name, level_sys_name, optional_level) values (3, 'taxonomy', 'super phylum', 'super_phylum', true);

insert into catalogue_levels (id, level_type, level_name, level_sys_name, optional_level) values (76, 'lithology', 'group', 'unit_group', false);
insert into catalogue_levels (id, level_type, level_name, level_sys_name, optional_level) values (77, 'lithology', 'sub group', 'unit_sub_group', true);
insert into catalogue_levels (id, level_type, level_name, level_sys_name, optional_level) values (78, 'lithology', 'rock', 'unit_rock', false);
insert into possible_upper_levels (level_ref, level_upper_ref) values (2, 1);
insert into possible_upper_levels (level_ref, level_upper_ref) values (3, 2);
insert into possible_upper_levels (level_ref, level_upper_ref) values (4, 2);
insert into possible_upper_levels (level_ref, level_upper_ref) values (4, 3);
insert into possible_upper_levels (level_ref, level_upper_ref) values (5, 4);
insert into possible_upper_levels (level_ref, level_upper_ref) values (6, 5);
insert into possible_upper_levels (level_ref, level_upper_ref) values (7, 4);
insert into possible_upper_levels (level_ref, level_upper_ref) values (7, 5);
insert into possible_upper_levels (level_ref, level_upper_ref) values (7, 6);
insert into possible_upper_levels (level_ref, level_upper_ref) values (8, 7);
insert into possible_upper_levels (level_ref, level_upper_ref) values (8, 6);
insert into possible_upper_levels (level_ref, level_upper_ref) values (8, 5);
insert into possible_upper_levels (level_ref, level_upper_ref) values (8, 4);
insert into possible_upper_levels (level_ref, level_upper_ref) values (9, 8);
insert into possible_upper_levels (level_ref, level_upper_ref) values (10, 9);
insert into possible_upper_levels (level_ref, level_upper_ref) values (11, 10);

insert into possible_upper_levels (level_ref, level_upper_ref) values (78, 77);
INSERT INTO gtu (id, code) VALUES (0,0);
INSERT INTO expeditions (id, name, name_ts, name_indexed) VALUES (0, '', to_tsvector(''), '');
INSERT INTO chronostratigraphy (id, name, name_indexed, level_ref) VALUES (0, '', '', 0);
INSERT INTO lithostratigraphy (id, name, name_indexed, level_ref) VALUES (0, '', '', 0);
INSERT INTO mineralogy (id, name, name_indexed, code, level_ref) VALUES (0, '', '', 0, 0);
INSERT INTO lithology (id, name, name_indexed, level_ref) VALUES (0, '', '', 0);
INSERT INTO taxonomy (id, name, name_indexed, level_ref) VALUES (0, '', '', 0);
INSERT INTO taxonomy (id, name, name_indexed, level_ref, status) VALUES (-3, 'Archaea', to_tsvector('Archaea'), 1, 'valid');
INSERT INTO taxonomy (id, name, name_indexed, level_ref, status) VALUES (-2, 'Bacteria', to_tsvector('Bacteria'), 1, 'valid');
INSERT INTO taxonomy (id, name, name_indexed, level_ref, status) VALUES (-1, 'Eucaryota', to_tsvector('Eucaryota'), 1, 'valid');
