From 3f67ff77a4fa3e132fcfe4b51c7ac4167e11fb84 Mon Sep 17 00:00:00 2001
From: yackob03 <jacob.moshenko@gmail.com>
Date: Mon, 20 Jan 2014 17:39:29 -0500
Subject: [PATCH] Add the permission proto table to the database.

---
 data/database.py  |   7 ++++---
 test/data/test.db | Bin 117760 -> 123904 bytes
 2 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/data/database.py b/data/database.py
index 9f8626082..e9c0ff6ff 100644
--- a/data/database.py
+++ b/data/database.py
@@ -134,8 +134,9 @@ class RepositoryPermission(BaseModel):
 
 
 class PermissionPrototype(BaseModel):
-  org = ForeignKeyField(User, index=True)
-  user = ForeignKeyField(User, index=True, null=True)
+  org = ForeignKeyField(User, index=True, related_name='orgpermissionproto')
+  user = ForeignKeyField(User, index=True, related_name='userpermissionproto',
+                         null=True)
   role = ForeignKeyField(Role)
 
   class Meta:
@@ -246,4 +247,4 @@ all_models = [User, Repository, Image, AccessToken, Role,
               RepositoryPermission, Visibility, RepositoryTag,
               EmailConfirmation, FederatedLogin, LoginService, QueueItem,
               RepositoryBuild, Team, TeamMember, TeamRole, Webhook,
-              LogEntryKind, LogEntry]
+              LogEntryKind, LogEntry, PermissionPrototype]
diff --git a/test/data/test.db b/test/data/test.db
index bc58279da13f6879374182a44543c36f5ca1ed8e..36011e3bdae87e11bf6eed47feaa5f165d407a95 100644
GIT binary patch
delta 4638
zcmbtX2~?9;7S2r`2|J=-P>=!z+4-}RsDRl>2uWlQ1eLNx1i~VlqURK`R;{%QeH~w`
zo$1s{J+;eBP4%}{D_WIl=ZsE!I!^0BnRc{`wackh+OgJo2}ng!drr+c`Ck6}-TU76
z-+SMm_pg0Qu=a0)$0I{eb2ywH`n~zF_NPgyG5wQdA8HEX9d;8-`r9J7yu+^0KqW7w
zET38m3>5Oz6m$zHWGg8sr4&RN6p|Au#KpQU@pM@W<(Be%S&>ep&ozp2_2ro*c7>&=
zT%=Lk6ef*EX*9_tqB2Qwo<(IbmDol4Qj<X{5sAc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