Skip to content
Snippets Groups Projects
Commit 790eb1d2 authored by roadscape's avatar roadscape
Browse files

add schema-dump command, fix imports

parent 42fcb984
No related branches found
No related tags found
No related merge requests found
......@@ -34,6 +34,10 @@ serve-local:
db-head-state:
curl -H 'Content-Type: application/json' -d '{"id":1,"jsonrpc":"2.0","method":"db_head_state"}' http://localhost:8080
.PHONY: dump-schema
dump-schema:
pg_dump -s -x --use-set-session-authorization hivepytest | sed -e '/^--/d' | awk -v RS= -v ORS='\n\n' '1' > schema.sql
ipython:
docker run -it $(PROJECT_DOCKER_RUN_ARGS) $(PROJECT_DOCKER_TAG) ipython
......
......@@ -12,7 +12,6 @@ from hive.utils.normalize import rep_log10, vests_amount
from hive.utils.timer import Timer
from hive.utils.account import safe_profile_metadata
from hive.utils.unique_fifo import UniqueFIFO
from hive.indexer.community import Community
log = logging.getLogger(__name__)
......@@ -80,6 +79,7 @@ class Accounts:
cls._ids[name] = _id
# post-insert: pass to communities to check for new registrations
from hive.indexer.community import Community
Community.register(new_names, block_date)
# account cache methods
......
......@@ -8,7 +8,6 @@ import ujson as json
from hive.db.adapter import Db
from hive.indexer.accounts import Accounts
from hive.indexer.posts import Posts
log = logging.getLogger(__name__)
......@@ -311,6 +310,8 @@ class CommunityOp:
assert self.account, 'permlink requires named account'
_permlink = read_key_str(self.op, 'permlink')
assert _permlink, 'must name a permlink'
from hive.indexer.posts import Posts
_pid, _depth = Posts.get_id_and_depth(self.account, _permlink)
assert _pid, 'invalid post: %s/%s' % (self.account, _permlink)
......
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