Fix index error on empty database
This commit is contained in:
parent
04a7585842
commit
c1ea47026d
1 changed files with 10 additions and 0 deletions
|
|
@ -1027,6 +1027,16 @@ class PGGraphStorage(BaseGraphStorage):
|
||||||
if self.db is None:
|
if self.db is None:
|
||||||
self.db = await ClientManager.get_client()
|
self.db = await ClientManager.get_client()
|
||||||
|
|
||||||
|
node1_id = "dummy_entity"
|
||||||
|
node1_data = {
|
||||||
|
"entity_id": node1_id,
|
||||||
|
"description": "dummy description",
|
||||||
|
"keywords": "dummy,keywords",
|
||||||
|
"entity_type": "dummy_type",
|
||||||
|
}
|
||||||
|
await self.upsert_node(node1_id, node1_data)
|
||||||
|
await self.delete_node(node1_id)
|
||||||
|
|
||||||
query = """CREATE INDEX entity_id_gin_idxSELECT ON %s."base" USING gin (properties);""" % (self.graph_name)
|
query = """CREATE INDEX entity_id_gin_idxSELECT ON %s."base" USING gin (properties);""" % (self.graph_name)
|
||||||
|
|
||||||
await self.db.execute(
|
await self.db.execute(
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue