Skip to content

Commit 8fb9020

Browse files
committed
started to re-define Identifiers table for storing synonyms
1 parent 36de690 commit 8fb9020

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

omnipath_metabo/schema/_main.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -126,8 +126,8 @@ def load(self):
126126
_log('inserting identifiers.')
127127
with raw_con.cursor() as cursor:
128128
query = """
129-
INSERT INTO identifiers (identifier, structure_id, resource_id) VALUES %s
130-
"""
129+
INSERT INTO identifiers (identifier, structure_id, resource_id, id_type) VALUES %s
130+
"""
131131
psycopg2.extras.execute_values(cursor, query, insert_ids, page_size = 1000)
132132

133133

omnipath_metabo/schema/_structure.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
from sqlalchemy import create_engine, Column, ForeignKey, Integer, String, types
1+
from sqlalchemy import Boolean, create_engine, Column, ForeignKey, Integer, String, types
22
from sqlalchemy.orm import relationship
33
from ._base import Base
44
from pypath.inputs import hmdb, swisslipids, lipidmaps, ramp
@@ -29,6 +29,9 @@ class Identifier(Base):
2929
nullable = False,
3030
)
3131
resource_id = Column(Integer, ForeignKey('resources.id'), nullable = False)
32+
authoritative = Column(Boolean)
33+
id_type = Column(Integer, ForeignKey('resources.id'), nullable = False)
34+
3235

3336

3437
class Resource(Base):

0 commit comments

Comments
 (0)