mirror of
https://gitlab.archlinux.org/archlinux/aurweb.git
synced 2025-02-03 10:43:03 +01:00
fix(models.package_source): fix primary key constraints
Signed-off-by: Kevin Morris <kevr@0cost.org>
This commit is contained in:
parent
22093c5c38
commit
5142447b7e
3 changed files with 12 additions and 5 deletions
|
@ -10,7 +10,10 @@ class PackageSource(Base):
|
|||
__table__ = schema.PackageSources
|
||||
__tablename__ = __table__.name
|
||||
__mapper_args__ = {
|
||||
"primary_key": [__table__.c.PackageID]
|
||||
"primary_key": [
|
||||
__table__.c.PackageID,
|
||||
__table__.c.Source
|
||||
]
|
||||
}
|
||||
|
||||
Package = relationship(
|
||||
|
@ -26,3 +29,6 @@ class PackageSource(Base):
|
|||
statement="Foreign key PackageID cannot be null.",
|
||||
orig="PackageSources.PackageID",
|
||||
params=("NULL"))
|
||||
|
||||
if not self.Source:
|
||||
self.Source = "/dev/null"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue