From ea7c3462cc617c975cecf8f902c42c179e1190a5 Mon Sep 17 00:00:00 2001 From: Pierre-Yves Chibon Date: Feb 20 2015 10:37:39 +0000 Subject: Make the primary key of PullRequest be a composite key and add a uuid The composite key is between id and project_id and the unique identifier is some sort of uuid --- diff --git a/progit/model.py b/progit/model.py index 3ee02b5..193d286 100644 --- a/progit/model.py +++ b/progit/model.py @@ -432,6 +432,7 @@ class PullRequest(BASE): __tablename__ = 'pull_requests' id = sa.Column(sa.Integer, primary_key=True) + uid = sa.Column(sa.String(32), unique=True) title = sa.Column( sa.Text, nullable=False) @@ -439,7 +440,7 @@ class PullRequest(BASE): sa.Integer, sa.ForeignKey( 'projects.id', ondelete='CASCADE', onupdate='CASCADE'), - nullable=False) + primary_key=True) branch = sa.Column( sa.Text(), nullable=False)