Ticket #1153: sequencing-update-script-draft-2.txt

File sequencing-update-script-draft-2.txt, 5.5 KB (added by Nicklas Nordborg, 13 years ago)
Line 
1What the update script needs to do
2==========================================================
3
41. Move [Label]:s to [Tag]:s with a subtype
5 - Make sure the 'Label' subtype exists in the db.
6 - Copy all labels to tags. Re-use the same id:s if
7 possible.
8 - Update all labeled extracts to use the new tags.
9
10 - Soft references: [Item.TAG] should re-use the [Item.LABEL]
11 id so we don't have to modify anything related to this.
12 Soft references using 'LABEL' or 'LabelData' must be fixed.
13 Hopefully the tags can use the same id:s as the labels.
14
15 - Delete the [Labels] table.
16 - Delete the [BioMaterials.label_id] column.
17
18
192. Convert [LabeledExtract]:s into [Extract]:s with a subtype
20 - Make sure the 'LabeledExtract' subtype exists in the db
21 - No move of labeled extract data is needed, just change
22 the discriminator column from 4 to 3.
23 - Switch from current labels to the new tags.
24
25 - Soft refefecens: The [Item.LABELEDEXTRACT] is removed and
26 all soft references to it must be changed to [Item.EXTRACT].
27 Item id:s don't change which is good.
28
29
303. Linking biomaterial parents
31 - Move parent links to the new table for [BioMaterialParent].
32 It is a one-to-one mapping (except for the 'dummy' column)
33 and so this should not be difficult.
34 - Pooled biomaterials with a single parent item should copy
35 the parent information to [BioMaterials.parent_id] column
36 and reset the pooled flag.
37
38 - Delete the [BioMaterialSources] table.
39
404. Move [Hybridization]:s to [PhysicalBioAssay]:s
41 - Make sure the 'Hybridization' subtype exists.
42 - Copy all data to the new table. It would be good if
43 we can use the old id:s otherwise keep track of
44 old vs. new id:s.
45 - Update [BioMaterialEvents] table to point to the
46 physical bioassays.
47
48 - Soft references: [Item.PHYSICALBIOASSAY] should re-use the
49 [Item.HYBRIDIZATION] id so we don't have to modify anything
50 related to this.
51 Soft references using 'HYBRIDIZATION' or 'HybridizationData'
52 must be fixed. Hopefully the bioassays can use the same id:s
53 as the hybridizations.
54
55 - Delete the [BioMaterialEvents.hybridization_id] column.
56
575. Move [Scan]:s to [DerivedBioAssaySet]
58 - Make sure the 'Scan' subtype exists
59 - Copy all data to the new table. Make sure the correct
60 physical bioassay is linked (easy if they keep the old
61 id:s).
62 - Create [DerivedBioAssay] for each array index used on the
63 hybridization the scan is taken from. Try to link the bioassay
64 with the extract on that index.
65 - Move images to [FileSet] for the bioassay set. Image properties
66 should be added as annotations.
67
68 - Update [RawBioassay]:s created from the scan to use the
69 derived bioassay instead.
70
71 - Soft references: [Item.DERIVEDBIOASSAYSET] should re-use the
72 [Item.SCAN] id so we don't have to modify anything
73 related to this.
74 Soft references using 'SCAN' or 'ScanData' must be fixed.
75 Hopefully the bioassay setss can use the same id:s as the
76 scans.
77
78 - Delete the [RawBioAssays.scan_id] column.
79 - Delete the [Images] table.
80 - Delete the [Scans] table.
81 - Delete the [Hybridizations] table.
82
836. Core plug-ins
84 Some of the core plug-ins are affected a lot by the changes.
85 - Labeled extract importer
86 - Hybridization importer
87 - Scan importer
88 - Raw bioassay importer
89 - Annotation importer?
90
91 I have not yet investigated what the best approach is. One option
92 is to disable the old plug-ins and create new plug-ins for the new
93 item types. The other biomaterial importers are also affected, but it
94 should be possible to update them with new functionality. Eg. work
95 on specific item subtype and parent/pooled item changes.
96
97
98
99Soft item references
100--------------------
101The database has several places with soft references. This is
102typically a two-column reference where one column holds the id
103of the item and the other the type of item. In most cases the
104type is the integer value from Item.getValue(), but it can also
105be the Item.name() value or the Item.getClass().getName() value.
106When we move and/or convert between item types we need to update
107the soft references.
108
109So far, I have found the following tables with soft references:
110
111 - AnnotationSets: item_type and item_id
112 Update the item_type and item_id so that it references the
113 new/moved item.
114
115 - AnnotationTypeItems: item_type
116 Update the item_type.
117
118 - AnyToAny: from_id, from_type, to_id, to_type
119 Update the id:s and type:s so that they references the
120 new/moved items.
121
122 - BioMaterialLists: member_type
123 Update the member_type.
124
125 - BioPlateTypes: biomaterial_type
126 Update the biomaterial_type.
127
128 - ChangeHistoryDetails: item_type and item_id
129 Update the item_type and item_id so that it references the
130 new/moved item.
131
132 - Contexts: item_type and item_id
133
134 - ContextSettings: value
135 Probably has settings related to most recently used
136 items. I guess it is easiest to simply remove those
137 settings for affected item types.
138
139 - ItemValues: data_class and data_class_id
140 Update to the new class and id.
141
142 - Jobs: context_item
143 Update to the new item type.
144
145 - Keys: item_type
146 Hmmm... remove/merge/or...???
147
148 - PluginDefinitionGuiContexts: item_type
149 Remove non-existing contexts and let plug-ins register
150 for new contexts themself.
151
152 -
153
154
155
156