         formule varchar,
         formule_indexed varchar,
         cristal_system varchar,
-        unit_class_ref classifications_ids,
+        unit_class_ref integer default 0 not null,
         unit_class_indexed classifications_names,
-        unit_division_ref classifications_ids,
+        unit_division_ref integer default 0 not null,
         unit_division_indexed classifications_names,
-        unit_family_ref classifications_ids,
+        unit_family_ref integer default 0 not null,
         unit_family_indexed classifications_names,
-        unit_group_ref classifications_ids,
+        unit_group_ref integer default 0 not null,
         unit_group_indexed classifications_names,
-        unit_variety_ref classifications_ids,
+        unit_variety_ref integer default 0 not null,
         unit_variety_indexed classifications_names,
         constraint pk_mineralogy primary key (id),
         constraint unq_mineralogy unique (path, name_indexed, level_ref),

create table taxonomy
       (
        id integer not null default nextval('taxonomy_id_seq'),
        domain_ref classifications_ids,
        domain_indexed classifications_names,
        kingdom_ref classifications_ids,
        kingdom_indexed classifications_names,
        super_phylum_ref classifications_ids,
        super_phylum_indexed classifications_names,
        phylum_ref classifications_ids,
        phylum_indexed classifications_names,
        sub_phylum_ref classifications_ids,
        sub_phylum_indexed classifications_names,
        infra_phylum_ref classifications_ids,
        infra_phylum_indexed classifications_names,
        super_cohort_botany_ref classifications_ids,
        super_cohort_botany_indexed classifications_names,
        cohort_botany_ref classifications_ids,
        cohort_botany_indexed classifications_names,
        sub_cohort_botany_ref classifications_ids,
        sub_cohort_botany_indexed classifications_names,
        infra_cohort_botany_ref classifications_ids,
        infra_cohort_botany_indexed classifications_names,
        super_class_ref classifications_ids,
        super_class_indexed classifications_names,
        class_ref classifications_ids,
        class_indexed classifications_names,
        sub_class_ref classifications_ids,
        sub_class_indexed classifications_names,
        infra_class_ref classifications_ids,
        infra_class_indexed classifications_names,
        super_division_ref classifications_ids,
        super_division_indexed classifications_names,
        division_ref classifications_ids,
        division_indexed classifications_names,
        sub_division_ref classifications_ids,
        sub_division_indexed classifications_names,
        infra_division_ref classifications_ids,
        infra_division_indexed classifications_names,
        super_legion_ref classifications_ids,
        super_legion_indexed classifications_names,
        legion_ref classifications_ids,
        legion_indexed classifications_names,
        sub_legion_ref classifications_ids,
        sub_legion_indexed classifications_names,
        infra_legion_ref classifications_ids,
        infra_legion_indexed classifications_names,
        super_cohort_zoology_ref classifications_ids,
        super_cohort_zoology_indexed classifications_names,
        cohort_zoology_ref classifications_ids,
        cohort_zoology_indexed classifications_names,
        sub_cohort_zoology_ref classifications_ids,
        sub_cohort_zoology_indexed classifications_names,
        infra_cohort_zoology_ref classifications_ids,
        infra_cohort_zoology_indexed classifications_names,
        super_order_ref classifications_ids,
        super_order_indexed classifications_names,
        order_ref classifications_ids,
        order_indexed classifications_names,
        sub_order_ref classifications_ids,
        sub_order_indexed classifications_names,
        infra_order_ref classifications_ids,
        infra_order_indexed classifications_names,
        section_zoology_ref classifications_ids,
        section_zoology_indexed classifications_names,
        sub_section_zoology_ref classifications_ids,
        sub_section_zoology_indexed classifications_names,
        super_family_ref classifications_ids,
        super_family_indexed classifications_names,
        family_ref classifications_ids,
        family_indexed classifications_names,
        sub_family_ref classifications_ids,
        sub_family_indexed classifications_names,
        infra_family_ref classifications_ids,
        infra_family_indexed classifications_names,
        super_tribe_ref classifications_ids,
        super_tribe_indexed classifications_names,
        tribe_ref classifications_ids,
        tribe_indexed classifications_names,
        sub_tribe_ref classifications_ids,
        sub_tribe_indexed classifications_names,
        infra_tribe_ref classifications_ids,
        infra_tribe_indexed classifications_names,
        genus_ref classifications_ids,
        genus_indexed classifications_names,
        sub_genus_ref classifications_ids,
        sub_genus_indexed classifications_names,
        section_botany_ref classifications_ids,
        section_botany_indexed classifications_names,
        sub_section_botany_ref classifications_ids,
        sub_section_botany_indexed classifications_names,
        serie_ref classifications_ids,
        serie_indexed classifications_names,
        sub_serie_ref classifications_ids,
        sub_serie_indexed classifications_names,
        super_species_ref classifications_ids,
        super_species_indexed classifications_names,
        species_ref classifications_ids,
        species_indexed classifications_names,
        sub_species_ref classifications_ids,
        sub_species_indexed classifications_names,
        variety_ref classifications_ids,
        variety_indexed classifications_names,
        sub_variety_ref classifications_ids,
        sub_variety_indexed classifications_names,
        form_ref classifications_ids,
        form_indexed classifications_names,
        sub_form_ref classifications_ids,
        sub_form_indexed classifications_names,
        abberans_ref classifications_ids,
        abberans_indexed classifications_names,
        extinct boolean default false not null,
        constraint pk_taxonomy primary key (id),

create table lithology
       (
        id integer not null default nextval('lithology_id_seq'),
        unit_main_group_ref integer default 0 not null,
        unit_main_group_indexed classifications_names,
        unit_group_ref integer default 0 not null,
        unit_group_indexed classifications_names,
        unit_sub_group_ref integer default 0 not null,
        unit_sub_group_indexed classifications_names,
        unit_rock_ref integer default 0 not null,
        unit_rock_indexed classifications_names,
        constraint pk_lithology primary key (id),
        constraint unq_lithology unique (path, name_indexed, level_ref),
