Unique constraint on MediaFile.path

This commit is contained in:
Fabio Manganiello 2019-02-17 17:17:20 +01:00
parent 497d7770c6
commit c7f0783615

View file

@ -254,7 +254,7 @@ class MediaFile(Base):
id = Column(Integer, primary_key=True)
directory_id = Column(Integer, ForeignKey(
'MediaDirectory.id', ondelete='CASCADE'), nullable=False)
path = Column(String, nullable=False)
path = Column(String, nullable=False, unique=True)
indexed_at = Column(DateTime)
@classmethod