mirror of
https://gitlab.archlinux.org/archlinux/aurweb.git
synced 2025-02-03 10:43:03 +01:00
PackageRelation: fix primary key relationships
Signed-off-by: Kevin Morris <kevr@0cost.org>
This commit is contained in:
parent
b4e46450b5
commit
13b4dbf541
2 changed files with 9 additions and 9 deletions
|
@ -1,4 +1,4 @@
|
|||
from sqlalchemy import Column, ForeignKey, Integer
|
||||
from sqlalchemy import Column, ForeignKey, Integer, String
|
||||
from sqlalchemy.exc import IntegrityError
|
||||
from sqlalchemy.orm import backref, relationship
|
||||
|
||||
|
@ -26,7 +26,9 @@ class PackageRelation(Base):
|
|||
"RelationType", backref=backref("package_relations", lazy="dynamic"),
|
||||
foreign_keys=[RelTypeID])
|
||||
|
||||
__mapper_args__ = {"primary_key": [PackageID, RelTypeID]}
|
||||
RelName = Column(String(255), unique=True)
|
||||
|
||||
__mapper_args__ = {"primary_key": [PackageID, RelName]}
|
||||
|
||||
def __init__(self,
|
||||
Package: aurweb.models.package.Package = None,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue