From 2114d5cedf9e24e8aad91f02e419eb9175289126 Mon Sep 17 00:00:00 2001 From: Jules Laplace Date: Sat, 27 Jun 2020 13:48:55 +0200 Subject: update db, add paragraph table --- animism-align/cli/app/sql/models/timestamp.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'animism-align/cli/app/sql/models/timestamp.py') diff --git a/animism-align/cli/app/sql/models/timestamp.py b/animism-align/cli/app/sql/models/timestamp.py index 60e9007..c2bf410 100644 --- a/animism-align/cli/app/sql/models/timestamp.py +++ b/animism-align/cli/app/sql/models/timestamp.py @@ -11,9 +11,10 @@ from app.settings import app_cfg class Timestamp(Base): """Table for storing references to graphs""" - __tablename__ = 'graph' + __tablename__ = 'timestamp' id = Column(Integer, primary_key=True) type = Column(String(16, convert_unicode=True), nullable=False) + paragraph_id = Column(Integer, ForeignKey('paragraph.id'), nullable=True) start_ts = Column(Float, nullable=False) end_ts = Column(Float, nullable=True) sentence = Column(Text(convert_unicode=True), nullable=True) @@ -23,6 +24,7 @@ class Timestamp(Base): return { 'id': self.id, 'type': self.type, + 'paragraph_id': self.paragraph_id, 'start_ts': self.start_ts, 'end_ts': self.end_ts, 'sentence': self.description, -- cgit v1.2.3-70-g09d2