Project

General

Profile

« Previous | Next » 

Revision 7187

schemas/vegbien.sql: taxonlabel: Removed no longer used matched_label_fit_fraction. Use taxondetermination.taxonfit instead.

View differences:

schemas/vegbien.my.sql
465 465

  
466 466

  
467 467
--
468
-- Name: taxonlabel_1_matched_label_min_fit(); Type: FUNCTION; Schema: public; Owner: -
469
--
470

  
471

  
472

  
473

  
474
--
475 468
-- Name: taxonlabel_2_set_canon_label_id_on_insert(); Type: FUNCTION; Schema: public; Owner: -
476 469
--
477 470

  
......
504 497
    taxonstatus varchar(255),
505 498
    canon_label_id int(11),
506 499
    matched_label_id int(11),
507
    matched_label_fit_fraction double precision,
508 500
    parent_id int(11),
509 501
    taxonepithet varchar(255),
510 502
    rank varchar(255),
......
556 548

  
557 549

  
558 550
--
559
-- Name: COLUMN taxonlabel.matched_label_fit_fraction; Type: COMMENT; Schema: public; Owner: -
560
--
561

  
562

  
563

  
564

  
565
--
566 551
-- Name: COLUMN taxonlabel.parent_id; Type: COMMENT; Schema: public; Owner: -
567 552
--
568 553

  
......
6265 6250

  
6266 6251

  
6267 6252
--
6268
-- Name: taxonlabel_1_matched_label_min_fit; Type: TRIGGER; Schema: public; Owner: -
6269
--
6270

  
6271

  
6272

  
6273

  
6274
--
6275 6253
-- Name: taxonlabel_2_set_canon_label_id_on_insert; Type: TRIGGER; Schema: public; Owner: -
6276 6254
--
6277 6255

  
schemas/vegbien.sql
1111 1111

  
1112 1112

  
1113 1113
--
1114
-- Name: taxonlabel_1_matched_label_min_fit(); Type: FUNCTION; Schema: public; Owner: -
1115
--
1116

  
1117
CREATE FUNCTION taxonlabel_1_matched_label_min_fit() RETURNS trigger
1118
    LANGUAGE plpgsql
1119
    AS $$
1120
BEGIN
1121
    IF new.matched_label_id IS NOT NULL
1122
        AND new.matched_label_fit_fraction < 0.8 THEN -- insufficient match
1123
        new.matched_label_id = NULL;
1124
        new.matched_label_fit_fraction = NULL;
1125
    END IF;
1126
    RETURN new;
1127
END;
1128
$$;
1129

  
1130

  
1131
--
1132 1114
-- Name: taxonlabel_2_set_canon_label_id_on_insert(); Type: FUNCTION; Schema: public; Owner: -
1133 1115
--
1134 1116

  
......
1184 1166
    taxonstatus taxonomic_status,
1185 1167
    canon_label_id integer,
1186 1168
    matched_label_id integer,
1187
    matched_label_fit_fraction double precision,
1188 1169
    parent_id integer,
1189 1170
    taxonepithet text,
1190 1171
    rank taxonrank,
1191 1172
    taxonomicname text,
1192 1173
    accessioncode text,
1193
    CONSTRAINT taxonlabel_matched_label_fit_fraction_range CHECK (((matched_label_fit_fraction >= (0)::double precision) AND (matched_label_fit_fraction <= (1)::double precision))),
1194 1174
    CONSTRAINT taxonlabel_required_key CHECK ((((sourceaccessioncode IS NOT NULL) OR (taxonepithet IS NOT NULL)) OR (taxonomicname IS NOT NULL)))
1195 1175
);
1196 1176

  
......
1248 1228

  
1249 1229

  
1250 1230
--
1251
-- Name: COLUMN taxonlabel.matched_label_fit_fraction; Type: COMMENT; Schema: public; Owner: -
1252
--
1253

  
1254
COMMENT ON COLUMN taxonlabel.matched_label_fit_fraction IS 'The closeness of fit of the matched label.';
1255

  
1256

  
1257
--
1258 1231
-- Name: COLUMN taxonlabel.parent_id; Type: COMMENT; Schema: public; Owner: -
1259 1232
--
1260 1233

  
......
7421 7394

  
7422 7395

  
7423 7396
--
7424
-- Name: taxonlabel_1_matched_label_min_fit; Type: TRIGGER; Schema: public; Owner: -
7425
--
7426

  
7427
CREATE TRIGGER taxonlabel_1_matched_label_min_fit BEFORE INSERT OR UPDATE ON taxonlabel FOR EACH ROW EXECUTE PROCEDURE taxonlabel_1_matched_label_min_fit();
7428

  
7429

  
7430
--
7431 7397
-- Name: taxonlabel_2_set_canon_label_id_on_insert; Type: TRIGGER; Schema: public; Owner: -
7432 7398
--
7433 7399

  

Also available in: Unified diff