Skip to content

Add region source to both classifications and elements

Erwan Rouchet requested to merge migrate-region-source into master

The regions migration was done before the addition of sources on elements, but due to the order in which they have been merged, sources were added before it.

To avoid re-running the documents.0009 migration, one can use the following SQL query, assuming nobody has yet created new elements with the new types created from regions:

UPDATE documents_element elt SET elt.source_id = cls.source_id
FROM documents_classification cls
WHERE elt.id = cls.element_id
AND elt.type_id IN (SELECT id from documents_elementtype WHERE slug LIKE 'region_%');
Edited by Erwan Rouchet

Merge request reports

Loading