[PATCH eac V4] Modify migrations for the 0.9.0 version

Frank Bessou frank.bessou at logilab.fr
Mon Sep 30 17:37:46 CEST 2019


Applied after modifying commit message (d2a487be4839).

On 30/09/2019 17:13, 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 cbd09e48d162075c4b56c87777e394638576ca61
> # Parent  4dcecb5763c19a6024420419a5d550d3d1bfa3cf
> # Available At http://hg.logilab.org/review/cubes/eac
> #              hg pull http://hg.logilab.org/review/cubes/eac -r cbd09e48d162
> Modify migrations for the 0.9.0 version
> 
> 1. Converting place to name
>   - Introduced in changeset: f6c054166efd
> 2. Do not migrate dates of ChronologicalRelation:
>   - 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 4dcecb5763c1 -r cbd09e48d162 cubicweb_eac/migration/0.9.0_Any.py
> --- a/cubicweb_eac/migration/0.9.0_Any.py	Mon Jul 22 17:04:10 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,8 +34,6 @@
>                  'script_code'):
>       add_attribute('NameEntry', attrib)
>   
> -add_relation_type('date_relation')
> -
>   for etype in ('AssociationRelation', 'ChronologicalRelation',
>                 'HierarchicalRelation', 'Mandate', 'LegalStatus',
>                 'Occupation', 'EACResourceRelation'):
> @@ -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