[PATCH eac V3] Modify migrations for the 0.9.0 version

Guillaume Vandevelde guillaume.vandevelde at logilab.fr
Mon Sep 30 15:56:13 CEST 2019


# 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')



More information about the saem-devel mailing list