Includes signing_ts into params for insert_comment

This commit is contained in:
Oleg Silkin 2019-06-10 20:24:06 -04:00
parent 519dffd3fa
commit 4d35bf3b9d
2 changed files with 3 additions and 2 deletions

View file

@ -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(

View file

@ -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: