File tree Expand file tree Collapse file tree 1 file changed +3
-6
lines changed Expand file tree Collapse file tree 1 file changed +3
-6
lines changed Original file line number Diff line number Diff line change 9
9
Numeric ,
10
10
Index ,
11
11
UniqueConstraint ,
12
+ func
12
13
)
13
14
from sqlalchemy .orm import relationship
14
15
from ._base import Base
@@ -26,19 +27,15 @@ class Structure(Base):
26
27
id = Column (Integer , primary_key = True )
27
28
name = Column (String )
28
29
smiles = Column (String )
29
- inchi = Column (String (4096 ), unique = True )
30
+ inchi = Column (String (4096 ), unique = True )
30
31
mol = Column (MolType )
31
32
identifier = relationship (
32
33
'Identifier' ,
33
34
backref = 'structure' ,
34
35
foreign_keys = 'Identifier.structure_id'
35
36
)
36
37
__table_args__ = (
37
- UniqueConstraint (
38
- 'inchi' ,
39
- name = 'uq_inchi' ,
40
- postgresql_using = 'hash' # Specify the index type here
41
- ),
38
+ Index ('inchi_large_index' , func .md5 (inchi ), unique = True ),
42
39
)
43
40
44
41
You can’t perform that action at this time.
0 commit comments