# HG changeset patch # User Søren Løvborg # Date 2016-09-19 14:46:12 # Node ID f4059fe161185ea9a710941272707bc1ae37e3e3 # Parent 2d216fd7d5a2c527ddb5fc2000ab70f5ad4a4834 db: rename ChangesetStatus.changeset_comment_id to comment_id This ensures consistency with the existing "comment" relationship, as well as the foreign key (ChangesetComment.comment_id). diff --git a/kallithea/controllers/changeset.py b/kallithea/controllers/changeset.py --- a/kallithea/controllers/changeset.py +++ b/kallithea/controllers/changeset.py @@ -257,11 +257,11 @@ class ChangesetController(BaseRepoContro revision=changeset.raw_id)) # Status change comments - mostly from pull requests - comments.update((st.changeset_comment_id, st.comment) + comments.update((st.comment_id, st.comment) for st in ChangesetStatusModel() .get_statuses(c.db_repo.repo_id, changeset.raw_id, with_revisions=True) - if st.changeset_comment_id is not None) + if st.comment_id is not None) inlines = ChangesetCommentsModel() \ .get_inline_comments(c.db_repo.repo_id, diff --git a/kallithea/model/db.py b/kallithea/model/db.py --- a/kallithea/model/db.py +++ b/kallithea/model/db.py @@ -2263,7 +2263,7 @@ class ChangesetStatus(Base, BaseDbModel) user_id = Column(Integer(), ForeignKey('users.user_id'), nullable=False) revision = Column(String(40), nullable=True) status = Column(String(128), nullable=False, default=DEFAULT) - changeset_comment_id = Column(Integer(), ForeignKey('changeset_comments.comment_id'), nullable=False) + comment_id = Column('changeset_comment_id', Integer(), ForeignKey('changeset_comments.comment_id'), nullable=False) modified_at = Column(DateTime(), nullable=False, default=datetime.datetime.now) version = Column(Integer(), nullable=False, default=0) pull_request_id = Column(Integer(), ForeignKey('pull_requests.pull_request_id'), nullable=True)