From 988e67fd9652b1c3b8f07506465e336db98585b4 Mon Sep 17 00:00:00 2001 From: malmans2 Date: Tue, 29 Oct 2024 16:46:14 +0100 Subject: [PATCH] use name --- cacholote/database.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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" )