CREATE TABLE "elements" (
    "element_id" INTEGER NOT NULL CONSTRAINT "pk_elements" PRIMARY KEY AUTOINCREMENT,
    "class_name" TEXT NOT NULL,
    "observation_utc_timestamp" TEXT NULL,
    "upload_utc_timestamp" TEXT NULL,
    "user" TEXT NULL,
    "comment" TEXT NULL,
    "place_name" TEXT NULL,
    "lat" REAL NULL,
    "lng" REAL NULL,
    "symbol_radius" REAL NULL,
    "symbol_bg_color" TEXT NULL,
    "symbol_fg_color" TEXT NULL,
    "filename" TEXT NULL,
    "exif_make" TEXT NULL,
    "exif_model" TEXT NULL,
    "exif_date_time_original_utc" TEXT NULL,
    "state" INTEGER NULL,
    "individual_id" INTEGER NULL,
    "head_body_length" REAL NULL,
    "mass" REAL NULL,
    "gender_feature" INTEGER NULL,
    "origin" INTEGER NULL,
    "genotype" INTEGER NULL,
    "phenotype" INTEGER NULL,
    "measure_data_serialized" TEXT NULL,
    "pattern_image_src" TEXT NULL,
    "m_lnet_result_serialized" TEXT NULL,
    "share_of_black" REAL NULL,
    "center_of_mass_x" REAL NULL,
    "std_deviation" REAL NULL,
    "entropy_x" REAL NULL,
    "monitoring" INTEGER NULL,
    "quality" INTEGER NULL,
    "abc" INTEGER NULL,
    "taxon_invariant_name" TEXT NULL,
    "stadium" INTEGER NULL,
    "count" INTEGER NULL,
    CONSTRAINT "fk_elements_individuals_individual_id" FOREIGN KEY ("individual_id") REFERENCES "individuals" ("id")
);
CREATE INDEX "ix_elements_element_id_observation_utc_timestamp" ON "elements" ("element_id", "observation_utc_timestamp");
CREATE INDEX "ix_elements_individual_id" ON "elements" ("individual_id");
DROP TABLE "captures";
DROP TABLE "habitatfotos";
DROP TABLE "livingbeings";
DROP TABLE "fotos";
DROP TABLE "observations";
