-
Notifications
You must be signed in to change notification settings - Fork 192
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update archive version: 0.9 -> 0.10 (#4561)
Fixes a bug whereby archives created with the latest code fail to import in the last v1.4.2 release (if they contain group extras). This update imposes that these new archives are no longer compatible with v1.4.2
- Loading branch information
1 parent
def9a03
commit 810dc56
Showing
10 changed files
with
34 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
# -*- coding: utf-8 -*- | ||
########################################################################### | ||
# Copyright (c), The AiiDA team. All rights reserved. # | ||
# This file is part of the AiiDA code. # | ||
# # | ||
# The code is hosted on GitHub at https://github.com/aiidateam/aiida-core # | ||
# For further information on the license, see the LICENSE.txt file # | ||
# For further information please visit http://www.aiida.net # | ||
########################################################################### | ||
"""Migration from v0.9 to v0.10, used by `verdi export migrate` command.""" | ||
# pylint: disable=invalid-name | ||
from aiida.tools.importexport.archive.common import CacheFolder | ||
|
||
from .utils import verify_metadata_version, update_metadata | ||
|
||
|
||
def migrate_v9_to_v10(folder: CacheFolder): | ||
"""Migration of archive files from v0.9 to v0.10.""" | ||
old_version = '0.9' | ||
new_version = '0.10' | ||
|
||
_, metadata = folder.load_json('metadata.json') | ||
|
||
verify_metadata_version(metadata, old_version) | ||
update_metadata(metadata, new_version) | ||
|
||
metadata['all_fields_info']['Node']['attributes'] = {'convert_type': 'jsonb'} | ||
metadata['all_fields_info']['Node']['extras'] = {'convert_type': 'jsonb'} | ||
metadata['all_fields_info']['Group']['extras'] = {'convert_type': 'jsonb'} | ||
|
||
folder.write_json('metadata.json', metadata) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.