You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# 1. **`obj_head.classif_id`**: Points to `taxonomy.id`. This represents the current classification of an object.
426
+
# 2. **`objectsclassifhisto.classif_id`**: Points to `taxonomy.id` (with `ondelete="CASCADE"`). This stores the history of classifications for an object.
427
+
# 3. **`taxo_change_log.to_id`**: Points to `taxonomy.id` (with `ondelete="CASCADE"`). This logs the target taxon in a mass classification change.
428
+
# 4. **`taxo_change_log.from_id`**: Points to `taxonomy.id` (with `ondelete="CASCADE"`). This logs the original taxon in a mass classification change.
429
+
# 5. **`prediction.classif_id`**: Points to `taxonomy.id` (with `ondelete="CASCADE"`). This stores the predicted taxon for an object.
430
+
# 6. **`prediction_histo.classif_id`**: Points to `taxonomy.id` (with `ondelete="CASCADE"`). This stores the history of predicted taxa.
431
+
#### Other Implicit Relations
432
+
# * **`taxonomy.parent_id`**: Although not explicitly defined with a `ForeignKey` constraint in the SQLAlchemy model (it is a simple `INTEGER` column), it logically points to `taxonomy.id` to represent the taxonomic tree structure.
433
+
# * **`taxonomy.rename_to`**: Similarly, this `INTEGER` column is used to store an "advised" target taxon for mass category changes, logically referring to another `taxonomy.id`.
434
+
# * **`taxo_recast.transforms`**: This `JSONB` column stores mapping in the form `{from:to}`, where both values are taxonomic IDs, though they are not enforced by database-level foreign key constraints.
435
+
436
+
# We want to protect 1. and 2.
437
+
logger.info("Taxo delete, list: %s", to_delete)
438
+
sql=text("SELECT DISTINCT objid FROM obj_head WHERE classif_id = ANY (:een)")
0 commit comments