[PATCH eac V2] Modify migrations for the 0.9.0 version

Frank Bessou frank.bessou at logilab.fr
Mon Sep 30 13:59:28 CEST 2019



On 30/09/2019 12:25, Guillaume Vandevelde wrote:
> # HG changeset patch
> # User Guillaume Vandevelde <gvandevelde at logilab.fr>
> # Date 1567786074 -7200
> #      Fri Sep 06 18:07:54 2019 +0200
> # Node ID 4c7c25a0763e70612480c8c8f696093d997da677
> # Parent  74dcbed9788d9adf46cdaccb220bbf1ffd0e0f4c
> # Available At http://hg.logilab.org/review/cubes/eac
> #              hg pull http://hg.logilab.org/review/cubes/eac -r 4c7c25a0763e
> Modify migrations for the 0.9.0 version
> 
> 1. Converting place to name
>   - Introduced in changeset: f6c054166efd
> 2. Remove ChronologicalRelation:

Should be : "Do not migrate dates of ChronologicalRelation" (I suppose 
the relation still exist).


>   - Introduced in changeset: 901576a43c42
> 3. Remove explicitly adding `place_entry_relation`
>   - Introduced in changeset: f6c054166efd
> 4. Get the precise names of attributes that are sync for AuthorityRecord
>   - Introduced in changeset: a3aa1352f14e
> 
> Change some lines to adapts to previous changes in the 0.3.0
> migrations.
> 
> Removed some commands that was not needed.
> 
> diff -r 74dcbed9788d -r 4c7c25a0763e cubicweb_eac/migration/0.9.0_Any.py
> --- a/cubicweb_eac/migration/0.9.0_Any.py	Fri Aug 30 12:23:21 2019 +0200
> +++ b/cubicweb_eac/migration/0.9.0_Any.py	Fri Sep 06 18:07:54 2019 +0200
> @@ -19,7 +19,7 @@
>   
>   for agent_eid, name, exturi_eid, in cnx.execute(
>           'Any X, N, E WHERE X is AgentPlace, X name N, X equivalent_concept E?'):
> -    cnx.create_entity('PlaceEntry', place=name,
> +    cnx.create_entity('PlaceEntry', name=name,
>                         reverse_place_entry_relation=agent_eid,
>                         equivalent_concept=exturi_eid)
>   
> @@ -34,9 +34,7 @@
>                  'script_code'):
>       add_attribute('NameEntry', attrib)
>   
> -add_relation_type('date_relation')
> -
> -for etype in ('AssociationRelation', 'ChronologicalRelation', > +for etype in ('AssociationRelation',


I don't get why you remove this migration for ChronologicalRelations, 
even after having read 901576a43c42. :p


>                 'HierarchicalRelation', 'Mandate', 'LegalStatus',
>                 'Occupation', 'EACResourceRelation'):
>       rql(
> @@ -54,12 +52,11 @@
>                 'AgentFunction', 'LegalStatus', 'AgentPlace', 'Structure'):
>       add_attribute(etype, 'items')
>   
> -add_relation_type('place_entry_relation')
> -
>   add_attribute('Activity', 'agent_type')
>   
>   add_attribute('AuthorityRecord', 'languages')
>   add_relation_definition('EACResourceRelation', 'resource_relation_resource',
>                           'AuthorityRecord')
>   
> -sync_schema_props_perms('AuthorityRecord')
> +sync_schema_props_perms('record_id')
> +sync_schema_props_perms('isni')
> 

-- 
Frank Bessou
Logilab         https://www.logilab.fr



More information about the saem-devel mailing list