Closed xsrust closed 7 years ago
dmponline=# select id, title, version, customization_of, dmptemplate_id from templates where dmptemplate_id = 829965731;
id | title | version | customization_of | dmptemplate_id
------+---------------+---------+------------------+----------------
1 | AHRC Template | 0 | | 829965731
12 | AHRC Template | 0 | 829965731 | 829965731
16 | AHRC Template | 0 | 829965731 | 829965731
21 | AHRC Template | 0 | 829965731 | 829965731
29 | AHRC Template | 0 | 829965731 | 829965731
31 | AHRC Template | 1 | | 829965731
32 | AHRC Template | 0 | 829965731 | 829965731
38 | AHRC Template | 0 | 829965731 | 829965731
45 | AHRC Template | 0 | 829965731 | 829965731
56 | AHRC Template | 0 | 829965731 | 829965731
57 | AHRC Template | 0 | 829965731 | 829965731
65 | AHRC Template | 0 | 829965731 | 829965731
88 | AHRC Template | 0 | 829965731 | 829965731
99 | AHRC Template | 0 | 829965731 | 829965731
130 | AHRC Template | 0 | 829965731 | 829965731
145 | AHRC Template | 0 | 829965731 | 829965731
147 | AHRC Template | 0 | 829965731 | 829965731
150 | AHRC Template | 0 | 829965731 | 829965731
152 | AHRC Template | 0 | 829965731 | 829965731
166 | AHRC Template | 0 | 829965731 | 829965731
175 | AHRC Template | 0 | 829965731 | 829965731
179 | AHRC Template | 0 | 829965731 | 829965731
183 | AHRC Template | 0 | 829965731 | 829965731
186 | AHRC Template | 0 | 829965731 | 829965731
204 | AHRC Template | 0 | 829965731 | 829965731
207 | AHRC Template | 0 | 829965731 | 829965731
219 | AHRC Template | 0 | 829965731 | 829965731
221 | AHRC Template | 0 | 829965731 | 829965731
225 | AHRC Template | 0 | 829965731 | 829965731
238 | AHRC Template | 0 | 829965731 | 829965731
245 | AHRC Template | 0 | 829965731 | 829965731
267 | AHRC Template | 0 | 829965731 | 829965731
310 | AHRC Template | 0 | 829965731 | 829965731
290 | AHRC Template | 0 | 829965731 | 829965731
295 | AHRC Template | 0 | 829965731 | 829965731
318 | AHRC Template | 0 | 829965731 | 829965731
369 | AHRC Template | 0 | 829965731 | 829965731
344 | AHRC Template | 0 | 829965731 | 829965731
347 | AHRC Template | 0 | 829965731 | 829965731
348 | AHRC Template | 0 | 829965731 | 829965731
357 | AHRC Template | 0 | 829965731 | 829965731
Currently, the migration is not generating new dmptemplate_id's for customizations of templates.
Proper behavavior is that the customization_of field refers to the dmptemplate_id of the template being customized, while the dmptemplate_id field is unique for each set of versions of a template. i.e. there should not exist any template with customization_of = dmptemplate_id, nor should there exist two templates with the same version and dmptemplate_id.