<commit_before>DROP VIEW IF EXISTS synonyms_and_trade_names_view;
CREATE VIEW synonyms_and_trade_names_view AS
SELECT
  st.name_status,
  st.id,
  st.legacy_id,
  st.legacy_trade_code,
  st.data->'rank_name' AS rank_name,
  st.full_name,
  st.author_year,
  a.full_name AS accepted_full_name,
  a.author_year AS accepted_author_year,
  a.id AS accepted_id,
  a.data->'rank_name' AS accepted_rank_name,
  a.name_status AS accepted_name_status,
  a.data->'kingdom_name' AS accepted_kingdom_name,
  a.data->'phylum_name' AS accepted_phylum_name,
  a.data->'class_name' AS accepted_class_name,
  a.data->'order_name' AS accepted_order_name,
  a.data->'family_name' AS accepted_family_name,
  a.data->'genus_name' AS accepted_genus_name,
  a.data->'species_name' AS accepted_species_name,
  taxonomies.name AS taxonomy_name,
  to_char(st.created_at, 'DD/MM/YYYY') AS created_at,
  'TODO' AS created_by
FROM taxon_concepts st
JOIN taxonomies ON taxonomies.id = st.taxonomy_id
LEFT JOIN taxon_relationships
ON taxon_relationships.other_taxon_concept_id = st.id
LEFT JOIN taxon_concepts a
ON taxon_relationships.taxon_concept_id = a.id
WHERE st.name_status IN ('S', 'T');<commit_msg>Include taxonomy_id in the view<commit_after>DROP VIEW IF EXISTS synonyms_and_trade_names_view;
CREATE VIEW synonyms_and_trade_names_view AS
SELECT
  st.name_status,
  st.id,
  st.legacy_id,
  st.legacy_trade_code,
  st.data->'rank_name' AS rank_name,
  st.full_name,
  st.author_year,
  a.full_name AS accepted_full_name,
  a.author_year AS accepted_author_year,
  a.id AS accepted_id,
  a.data->'rank_name' AS accepted_rank_name,
  a.name_status AS accepted_name_status,
  a.data->'kingdom_name' AS accepted_kingdom_name,
  a.data->'phylum_name' AS accepted_phylum_name,
  a.data->'class_name' AS accepted_class_name,
  a.data->'order_name' AS accepted_order_name,
  a.data->'family_name' AS accepted_family_name,
  a.data->'genus_name' AS accepted_genus_name,
  a.data->'species_name' AS accepted_species_name,
  taxonomies.id AS taxonomy_id,
  taxonomies.name AS taxonomy_name,
  to_char(st.created_at, 'DD/MM/YYYY') AS created_at,
  'TODO' AS created_by
FROM taxon_concepts st
JOIN taxonomies ON taxonomies.id = st.taxonomy_id
LEFT JOIN taxon_relationships
ON taxon_relationships.other_taxon_concept_id = st.id
LEFT JOIN taxon_concepts a
ON taxon_relationships.taxon_concept_id = a.id
WHERE st.name_status IN ('S', 'T');
{'fraction_non_alphanumeric': 0.09166666666666666, 'fraction_numerical': 0.0, 'mean_word_length': 5.6143250688705235, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 21, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1549142', 'n_tokens_mistral': 971, 'n_tokens_neox': 934, 'n_words': 188}