fix: real nexus webhook format, atomic dedup, tested live
This commit is contained in:
@@ -3,7 +3,7 @@
|
||||
import datetime
|
||||
from enum import Enum
|
||||
|
||||
from sqlalchemy import Boolean, DateTime, ForeignKey, Integer, String, Text, func
|
||||
from sqlalchemy import Boolean, DateTime, ForeignKey, Integer, String, Text, UniqueConstraint, func
|
||||
from sqlalchemy.orm import Mapped, mapped_column, relationship
|
||||
|
||||
from guarddog_nexus.database import Base
|
||||
@@ -18,6 +18,9 @@ class ScanStatus(str, Enum):
|
||||
|
||||
class Scan(Base):
|
||||
__tablename__ = "scans"
|
||||
__table_args__ = (
|
||||
UniqueConstraint("package_name", "package_version", "repository", name="uq_scan_pkg"),
|
||||
)
|
||||
|
||||
id: Mapped[int] = mapped_column(Integer, primary_key=True, autoincrement=True)
|
||||
package_name: Mapped[str] = mapped_column(String(255), nullable=False)
|
||||
|
||||
Reference in New Issue
Block a user