From 4d35bf3b9d99b9e5549a6774365ceb28e71475a9 Mon Sep 17 00:00:00 2001 From: Oleg Silkin Date: Mon, 10 Jun 2019 20:24:06 -0400 Subject: [PATCH] Includes signing_ts into params for insert_comment --- schema/comments_ddl.sql | 3 ++- src/writes.py | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/schema/comments_ddl.sql b/schema/comments_ddl.sql index 5960824..af06eb8 100644 --- a/schema/comments_ddl.sql +++ b/schema/comments_ddl.sql @@ -14,6 +14,7 @@ CREATE TABLE IF NOT EXISTS COMMENT ( ParentId TEXT DEFAULT NULL, Signature TEXT DEFAULT NULL, Timestamp INTEGER NOT NULL, + SigningTs TEXT DEFAULT NULL, CONSTRAINT COMMENT_PRIMARY_KEY PRIMARY KEY (CommentId) ON CONFLICT IGNORE, CONSTRAINT COMMENT_SIGNATURE_SK UNIQUE (Signature) ON CONFLICT ABORT, CONSTRAINT COMMENT_CHANNEL_FK FOREIGN KEY (ChannelId) REFERENCES CHANNEL(ClaimId) @@ -22,7 +23,7 @@ CREATE TABLE IF NOT EXISTS COMMENT ( ON UPDATE CASCADE ON DELETE NO ACTION -- setting null implies comment is top level ); -ALTER TABLE COMMENT ADD COLUMN SigningTs TEXT DEFAULT NULL; +-- ALTER TABLE COMMENT ADD COLUMN SigningTs TEXT DEFAULT NULL; -- DROP TABLE IF EXISTS CHANNEL; CREATE TABLE IF NOT EXISTS CHANNEL( diff --git a/src/writes.py b/src/writes.py index 981ad1d..d293c8c 100644 --- a/src/writes.py +++ b/src/writes.py @@ -16,7 +16,7 @@ def create_comment(conn: sqlite3.Connection, comment: str, claim_id: str, channe try: comment_id = insert_comment( conn=conn, comment=comment, claim_id=claim_id, channel_id=channel_id, - signature=signature, parent_id=parent_id + signature=signature, parent_id=parent_id, signing_ts=signing_ts ) return get_comment_or_none(conn, comment_id) except sqlite3.IntegrityError as ie: