~cedric/newspipe

bba26593a3351d9a1cd20b2e182110e9d08329b0 — Cédric Bonhomme 2 months ago 83dd85d
updated foreign_keys for bookmarfs in tag.py
3 files changed, 6 insertions(+), 7 deletions(-)

M newspipe/models/bookmark.py
M newspipe/models/feed.py
M newspipe/models/tag.py
M newspipe/models/bookmark.py => newspipe/models/bookmark.py +1 -2
@@ 62,8 62,7 @@ class Bookmark(db.Model, RightMixin):
    tags = db.relationship(
        "BookmarkTag",
        back_populates="bookmark",
        cascade="all,delete-orphan",
        lazy=False,
        cascade="all, delete-orphan",
        foreign_keys="[BookmarkTag.bookmark_id]",
    )
    tags_proxy = association_proxy("tags", "text")

M newspipe/models/feed.py => newspipe/models/feed.py +3 -1
@@ 60,10 60,12 @@ class Feed(db.Model, RightMixin):
    last_error = db.Column(db.String(), default="")
    error_count = db.Column(db.Integer(), default=0)

    # relationship
    # foreign keys
    icon_url = db.Column(db.String(), db.ForeignKey("icon.url"), default=None)
    user_id = db.Column(db.Integer(), db.ForeignKey("user.id"))
    category_id = db.Column(db.Integer(), db.ForeignKey("category.id"))

    # relationship
    articles = db.relationship(
        Article,
        backref="source",

M newspipe/models/tag.py => newspipe/models/tag.py +2 -4
@@ 33,10 33,8 @@ class BookmarkTag(db.Model):
    text = db.Column(db.String, unique=False)

    # foreign keys
    user_id = db.Column(db.Integer, db.ForeignKey("user.id", ondelete="CASCADE"))
    bookmark_id = db.Column(
        db.Integer, db.ForeignKey("bookmark.id", ondelete="CASCADE")
    )
    user_id = db.Column(db.Integer, db.ForeignKey("user.id"))
    bookmark_id = db.Column(db.Integer, db.ForeignKey("bookmark.id"))

    # relationships
    bookmark = db.relationship(