Skip to content

Commit

Permalink
started to re-define Identifiers table for storing synonyms
Browse files Browse the repository at this point in the history
  • Loading branch information
deeenes committed Oct 17, 2024
1 parent 36de690 commit 8fb9020
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
4 changes: 2 additions & 2 deletions omnipath_metabo/schema/_main.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,8 +126,8 @@ def load(self):
_log('inserting identifiers.')
with raw_con.cursor() as cursor:
query = """
INSERT INTO identifiers (identifier, structure_id, resource_id) VALUES %s
"""
INSERT INTO identifiers (identifier, structure_id, resource_id, id_type) VALUES %s
"""
psycopg2.extras.execute_values(cursor, query, insert_ids, page_size = 1000)


Expand Down
5 changes: 4 additions & 1 deletion omnipath_metabo/schema/_structure.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from sqlalchemy import create_engine, Column, ForeignKey, Integer, String, types
from sqlalchemy import Boolean, create_engine, Column, ForeignKey, Integer, String, types
from sqlalchemy.orm import relationship
from ._base import Base
from pypath.inputs import hmdb, swisslipids, lipidmaps, ramp
Expand Down Expand Up @@ -29,6 +29,9 @@ class Identifier(Base):
nullable = False,
)
resource_id = Column(Integer, ForeignKey('resources.id'), nullable = False)
authoritative = Column(Boolean)
id_type = Column(Integer, ForeignKey('resources.id'), nullable = False)



class Resource(Base):
Expand Down

0 comments on commit 8fb9020

Please sign in to comment.