From fc8e1ac863af0b16e7de84e9351d6a02fff71f05 Mon Sep 17 00:00:00 2001 From: Dariusz Kedzierski <dkedzierski@syncad.com> Date: Wed, 24 Jun 2020 17:45:21 +0200 Subject: [PATCH] Title is no longer limited to 255 chars. Fix in votes --- hive/db/schema.py | 2 +- hive/indexer/posts.py | 1 + hive/indexer/votes.py | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/hive/db/schema.py b/hive/db/schema.py index 75cafd4f6..cb67ac902 100644 --- a/hive/db/schema.py +++ b/hive/db/schema.py @@ -160,7 +160,7 @@ def build_metadata(): sa.Table( 'hive_post_data', metadata, sa.Column('id', sa.Integer, primary_key=True, autoincrement=False), - sa.Column('title', VARCHAR(255), nullable=False, server_default=''), + sa.Column('title', TEXT, nullable=False, server_default=''), sa.Column('preview', VARCHAR(1024), nullable=False, server_default=''), sa.Column('img_url', VARCHAR(1024), nullable=False, server_default=''), sa.Column('body', TEXT, nullable=False, server_default=''), diff --git a/hive/indexer/posts.py b/hive/indexer/posts.py index 78322c5c2..db0823db6 100644 --- a/hive/indexer/posts.py +++ b/hive/indexer/posts.py @@ -131,6 +131,7 @@ class Posts: tags = filter(None, tags) from funcy.seqs import distinct tags = list(distinct(tags))[:5] + for tag in tags: Tags.add_tag(result['id'], tag) diff --git a/hive/indexer/votes.py b/hive/indexer/votes.py index 218c9f354..6451a1e34 100644 --- a/hive/indexer/votes.py +++ b/hive/indexer/votes.py @@ -122,7 +122,7 @@ class Votes: DB.query(actual_query) values.clear() - if len(values) >= 0: + if len(values) > 0: values_str = ','.join(values) actual_query = sql.format(values_str) DB.query(actual_query) -- GitLab