File tree Expand file tree Collapse file tree 1 file changed +5
-7
lines changed
Expand file tree Collapse file tree 1 file changed +5
-7
lines changed Original file line number Diff line number Diff line change @@ -76,13 +76,11 @@ def upgrade() -> None:
7676 f"ON UPDATE CASCADE;"
7777 )
7878
79- logger .info (f"Assigning new identifiers to knowledge_asset so they match the publication." )
80- op .execute (
81- f"UPDATE knowledge_asset "
82- f"JOIN (select identifier, knowledge_asset_id from publication) as pubs "
83- f"ON knowledge_asset.identifier=pubs.knowledge_asset_id "
84- f"SET knowledge_asset.identifier=pubs.identifier;"
85- )
79+ # There was a bug which resulted in knowledge asset identifiers not being generated
80+ logger .info ("Creating Identifiers of Knowledge Assets" )
81+ op .execute ("INSERT INTO knowledge_asset SELECT identifier, 'publication' FROM publication; " )
82+ logger .info ("Link publications to their parents" )
83+ op .execute ("UPDATE publication SET knowledge_asset_id=identifier; " )
8684
8785
8886def downgrade () -> None :
You can’t perform that action at this time.
0 commit comments