From 8d350dce038926cbcc47d1cc85cdad4d5143e065 Mon Sep 17 00:00:00 2001 From: Pierre-Yves Chibon Date: Feb 02 2015 18:44:12 +0000 Subject: Rework the model for the PullRequest object We want to store the branch from and branch to for when the review is opened and we want to know the commit start and commit stop when the request was merged. --- diff --git a/progit/model.py b/progit/model.py index 19f8564..16adf2d 100644 --- a/progit/model.py +++ b/progit/model.py @@ -401,27 +401,30 @@ class PullRequest(BASE): __tablename__ = 'pull_requests' id = sa.Column(sa.Integer, primary_key=True) + title = sa.Column( + sa.Text, + nullable=False) project_id = sa.Column( sa.Integer, sa.ForeignKey( 'projects.id', ondelete='CASCADE', onupdate='CASCADE'), nullable=False) + branch = sa.Column( + sa.Text(), + nullable=False) project_id_from = sa.Column( sa.Integer, sa.ForeignKey( 'projects.id', ondelete='CASCADE', onupdate='CASCADE'), nullable=False) - title = sa.Column( - sa.Text, - nullable=False) - branch = sa.Column( + branch_from = sa.Column( sa.Text(), nullable=False) - start_id = sa.Column( - sa.String(40), + commit_start = sa.Column( + sa.Text(), nullable=True) - stop_id = sa.Column( - sa.String(40), + commit_stop = sa.Column( + sa.Text(), nullable=False) user_id = sa.Column( sa.Integer,