diff --git a/cacholote/database.py b/cacholote/database.py index f20fd8d..a05c16f 100644 --- a/cacholote/database.py +++ b/cacholote/database.py @@ -39,8 +39,8 @@ association_table = sa.Table( "association_table", Base.metadata, - sa.Column("left_id", sa.ForeignKey("cache_entries.id"), primary_key=True), - sa.Column("right_id", sa.ForeignKey("cache_files.id"), primary_key=True), + sa.Column("cache_entries_id", sa.ForeignKey("cache_entries.id"), primary_key=True), + sa.Column("cache_files_name", sa.ForeignKey("cache_files.name"), primary_key=True), ) @@ -82,7 +82,7 @@ def __repr__(self) -> str: class CacheFile(Base): __tablename__ = "cache_files" - id = sa.Column(sa.Integer(), primary_key=True) + name = sa.Column(sa.String(), primary_key=True) cache_entries: sa.orm.Mapped[list[CacheEntry]] = sa.orm.relationship( secondary=association_table, back_populates="cache_files" )