Model need to be fixed

This commit is contained in:
mpabi 2024-06-20 19:55:30 +00:00
parent 40cc16cb4f
commit e790db7bb7
2 changed files with 6 additions and 4 deletions

View File

@ -7,8 +7,8 @@ class Sequence(Base):
__tablename__ = "sequences"
id = Column(Integer, primary_key=True, index=True)
name = Column(String, index=True)
description = Column(String)
name = Column(String(255), index=True)
description = Column(String(255))
sequence = Column(Text)
features = relationship("Feature", back_populates="sequence")
@ -17,8 +17,8 @@ class Feature(Base):
__tablename__ = "features"
id = Column(Integer, primary_key=True, index=True)
type = Column(String, index=True)
location = Column(String)
type = Column(String(255), index=True)
location = Column(String(255))
sequence = Column(Text)
qualifiers = Column(Text)

View File

@ -1,3 +1,4 @@
#%%
# entrypoint.py
from Bio import SeqIO
from sqlalchemy.orm import Session
@ -8,6 +9,7 @@ import json
# Tworzenie tabeli w bazie danych
Base.metadata.create_all(bind=engine)
#%%
def get_db():
db = SessionLocal()
try: