Commit dbbafc15 authored by Kevin Morris's avatar Kevin Morris
Browse files

bugfix: PackageKeyword should have two PKs


Signed-off-by: Kevin Morris's avatarKevin Morris <kevr@0cost.org>
parent 719fa82a
Pipeline #9173 passed with stage
in 1 minute and 55 seconds
from sqlalchemy import Column, ForeignKey, Integer
from sqlalchemy import Column, ForeignKey, Integer, String, text
from sqlalchemy.exc import IntegrityError
from sqlalchemy.orm import backref, relationship
......@@ -18,7 +18,11 @@ class PackageKeyword(Base):
"PackageBase", backref=backref("keywords", lazy="dynamic"),
foreign_keys=[PackageBaseID])
__mapper_args__ = {"primary_key": [PackageBaseID]}
Keyword = Column(
String(255), primary_key=True, nullable=False,
server_default=text("''"))
__mapper_args__ = {"primary_key": [PackageBaseID, Keyword]}
def __init__(self,
PackageBase: aurweb.models.package_base.PackageBase = None,
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment