[PATCH eac V3] Modify migrations for the 0.9.0 version

gvandevelde guillaume.vandevelde at logilab.fr
Mon Sep 30 17:02:32 CEST 2019


Changes applied in the 0.3.0 migration. changeset: 4dcecb5763c1

On 9/30/19 3:56 PM, 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 452aad0aba341b9dd75e3f6be98e85358c19904e
> # Parent  74dcbed9788d9adf46cdaccb220bbf1ffd0e0f4c
> # Available At http://hg.logilab.org/review/cubes/eac
> #              hg pull http://hg.logilab.org/review/cubes/eac -r 452aad0aba34
> 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 74dcbed9788d -r 452aad0aba34 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',
>                 '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')
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.cubicweb.org/pipermail/saem-devel/attachments/20190930/3ab7c456/attachment-0185.html>


More information about the saem-devel mailing list