Here the 2 tables description
with the 2 foreignkeys
> table1: chebi.compound_is_a
"chebi_id_fk" FOREIGN KEY (chebi_id) REFERENCES chebi.compound(chebi_id) ON UPDATE CASCADE ON DELETE CASCADE
> table 2:chebi.path_is_a_molecular_structure
"chebi_id_fk" FOREIGN KEY (chebi_id) REFERENCES chebi.compound(chebi_id) ON UPDATE CASCADE ON DELETE CASCADE
And the error message
Quote:
[ERROR] : : Foreign key name (chebi_id_fk) mapped to different tables! previous: org.hibernate.mapping.Table(chebi.compound_is_a) current:org.hibernate.mapping.Table(chebi.path_is_a_molecular_structure) [0]
TABLE 1
Code:
# \d [b][u]chebi.compound_is_a[/u][/b]
Table "chebi.compound_is_a"
Column | Type | Modifiers
------------+--------------------------------+------------------------
chebi_id | text | not null
related_id | text | not null
relation | text |
created | timestamp(0) without time zone | not null default now()
Indexes:
"compound_ancestor_pkey" primary key, btree (chebi_id, related_id)
"compound_is_a_chebi_id__idx" btree (chebi_id)
"compound_is_a_related_id__idx" btree (related_id)
"compound_is_a_relation__idx" btree (relation)
Foreign-key constraints:
"relation_fk" FOREIGN KEY (relation) REFERENCES chebi.relation(id) ON UPDATE CASCADE ON DELETE CASCADE
"related_id_fk" FOREIGN KEY (related_id) REFERENCES chebi.compound(chebi_id) ON UPDATE CASCADE ON DELETE CASCADE
"chebi_id_fk" FOREIGN KEY (chebi_id) REFERENCES chebi.compound(chebi_id) ON UPDATE CASCADE ON DELETE CASCADE
TABLE 2
Code:
# \d [b][u]chebi.path_is_a_molecular_structure[/u][/b]
Table "chebi.path_is_a_molecular_structure"
Column | Type | Modifiers
-----------+--------------------------------+-------------------------------------
chebi_id | text | not null
path | ltree | not null
root_name | text | default 'molecular structure'::text
root_id | text | default '24431'::text
created | timestamp(0) without time zone | not null default now()
Indexes:
"path_is_a_molecular_structure_pkey" primary key, btree (chebi_id, path)
"chebi_path_is_a_path_molecular_structure__idx" gist (path)
"path_is_a_molecular_structure__chebi_id__idx" btree (chebi_id)
Check constraints:
"path_is_a_molecular_structure_root_id_check" CHECK (root_id = '24431'::text)
"path_is_a_molecular_structure_root_name_check" CHECK (root_name = 'molecular structure'::text)
Foreign-key constraints:
"root_id_fk" FOREIGN KEY (root_id) REFERENCES chebi.compound(chebi_id) ON UPDATE CASCADE ON DELETE CASCADE
"chebi_id_fk" FOREIGN KEY (chebi_id) REFERENCES chebi.compound(chebi_id) ON UPDATE CASCADE ON DELETE CASCADE