Skip to content

Commit

Permalink
#833 providers json text to numeric
Browse files Browse the repository at this point in the history
  • Loading branch information
vancamti committed May 17, 2023
1 parent 62612ef commit c729be6
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions atramhasis/scripts/migrate_sqlalchemy_providers.py
Expand Up @@ -187,8 +187,9 @@ def migrate(skos_registry: Registry, session: Session):
)
else:
provider.metadata['atramhasis.id_generation_strategy'] = 'NUMERIC'
db_provider.meta = json.loads(json.dumps(provider.metadata, default=json_serial))

meta = json.loads(json.dumps(provider.metadata, default=json_serial))
meta["id"] = provider.conceptscheme_id
db_provider.meta = meta
db_provider.expand_strategy = ExpandStrategy[provider.expand_strategy.upper()]
db_provider.conceptscheme = session.get(ConceptScheme, provider.conceptscheme_id)
db_provider.id = provider.conceptscheme_id
Expand Down
2 changes: 1 addition & 1 deletion tests/scripts/test_migratie_sqlalchemy_providers.py
Expand Up @@ -62,7 +62,7 @@ def test_migrate(self):
self.assertEqual('urn:x-skosprovider:%s:%s', provider.uri_pattern)
self.assertEqual(
{
'id': 'EXTRA',
'id': int(provider.id),
'subject': [],
'atramhasis.id_generation_strategy': 'NUMERIC'
},
Expand Down

0 comments on commit c729be6

Please sign in to comment.