Skip to content
Snippets Groups Projects
Commit 07844132 authored by Mariusz Trela's avatar Mariusz Trela
Browse files

Name of view is changed

parent e400da2d
No related branches found
No related tags found
5 merge requests!456Release candidate v1 24,!230Setup monitoring with pghero,!138Small typos fixed,!135Enable postgres monitoring on CI server,!110Teh call `get_profile` works
......@@ -128,7 +128,6 @@ class DbState:
#'hive_posts_cache_ix32', # API: community created
#'hive_posts_cache_ix33', # API: community payout
#'hive_posts_cache_ix34', # API: community muted
'hive_accounts_ix1', # (cached_at, name)
'hive_accounts_ix5' # (cached_at, name)
]
......
......@@ -563,9 +563,9 @@ def setup(db):
# and posting/voting after an account updating, fixes `active_at` value immediately.
sql = """
DROP VIEW IF EXISTS public.hive_accounts_info;
DROP VIEW IF EXISTS public.hive_accounts_info_view;
CREATE OR REPLACE VIEW public.hive_accounts_info
CREATE OR REPLACE VIEW public.hive_accounts_info_view
AS
SELECT id,
name,
......
......@@ -16,7 +16,7 @@ log = logging.getLogger(__name__)
async def load_profiles(db, names):
"""`get_accounts`-style lookup for `get_state` compat layer."""
sql = """SELECT * FROM hive_accounts_info
sql = """SELECT * FROM hive_accounts_info_view
WHERE name IN :names"""
rows = await db.query_all(sql, names=tuple(names))
return [_condenser_profile_object(row) for row in rows]
......
......@@ -443,7 +443,7 @@ async def get_accounts(db, accounts: list):
location, website, profile_image, cover_image, followers, following,
proxy, post_count, proxy_weight, rank,
lastread_at, active_at, cached_at, raw_json
FROM hive_accounts_info WHERE name IN ({})""".format(",".join(names))
FROM hive_accounts_info_view WHERE name IN ({})""".format(",".join(names))
result = await db.query_all(sql)
for row in result:
......
......@@ -14,7 +14,7 @@ log = logging.getLogger(__name__)
async def load_accounts(db, names):
"""`get_accounts`-style lookup for `get_state` compat layer."""
sql = """SELECT * FROM hive_accounts_info
sql = """SELECT * FROM hive_accounts_info_view
WHERE name IN :names"""
rows = await db.query_all(sql, names=tuple(names))
return [_condenser_account_object(row) for row in rows]
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment