Merge pull request #2678 from solgenomics/BBase-15
[sgn.git] / db / 00103 / AddPhenomeProjectMdImageTable.pm
blobb1e6d0b492afd0177c01098447b2690d2ac16c47
1 #!/usr/bin/env perl
4 =head1 NAME
6 AddPhenomeProjectMdImageTable
8 =head1 SYNOPSIS
10 mx-run AddPhenomeProjectMdImageTable [options] -H hostname -D dbname -u username [-F]
12 this is a subclass of L<CXGN::Metadata::Dbpatch>
13 see the perldoc of parent class for more details.
15 =head1 DESCRIPTION
16 This patch adds a linking table called project_md_image to the phenome schema, which links project to metadata.md_image
17 This subclass uses L<Moose>. The parent class uses L<MooseX::Runnable>
19 =head1 AUTHOR
22 =head1 COPYRIGHT & LICENSE
24 Copyright 2010 Boyce Thompson Institute for Plant Research
26 This program is free software; you can redistribute it and/or modify
27 it under the same terms as Perl itself.
29 =cut
32 package AddPhenomeProjectMdImageTable;
34 use Moose;
35 use Bio::Chado::Schema;
36 use Try::Tiny;
37 use SGN::Model::Cvterm;
38 use JSON;
39 extends 'CXGN::Metadata::Dbpatch';
42 has '+description' => ( default => <<'' );
43 This patch adds a linking table called project_md_image to the phenome schema, which links project to metadata.md_image
45 has '+prereq' => (
46 default => sub {
47 [],
52 sub patch {
53 my $self=shift;
55 print STDOUT "Executing the patch:\n " . $self->name . ".\n\nDescription:\n ". $self->description . ".\n\nExecuted by:\n " . $self->username . " .";
57 print STDOUT "\nChecking if this db_patch was executed before or if previous db_patches have been executed.\n";
59 print STDOUT "\nExecuting the SQL commands.\n";
60 my $schema = Bio::Chado::Schema->connect( sub { $self->dbh->clone } );
62 my $terms = {
63 'project_md_image' => [
64 'raw_drone_imagery',
65 'stitched_drone_imagery',
66 'denoised_stitched_drone_imagery',
67 'cropped_stitched_drone_imagery',
68 'rotated_stitched_drone_imagery',
69 'rotated_stitched_temporary_drone_imagery',
70 'fourier_transform_stitched_drone_imagery',
71 'contours_stitched_drone_imagery',
72 'observation_unit_polygon_bw_imagery',
73 'observation_unit_polygon_rgb_imagery',
74 'observation_unit_polygon_rgb_imagery_channel_1',
75 'observation_unit_polygon_rgb_imagery_channel_2',
76 'observation_unit_polygon_rgb_imagery_channel_3',
77 'observation_unit_polygon_nrn_imagery',
78 'observation_unit_polygon_nren_imagery',
79 'observation_unit_polygon_blue_imagery',
80 'observation_unit_polygon_green_imagery',
81 'observation_unit_polygon_red_imagery',
82 'observation_unit_polygon_red_edge_imagery',
83 'observation_unit_polygon_nir_imagery',
84 'observation_unit_polygon_mir_imagery',
85 'observation_unit_polygon_fir_imagery',
86 'observation_unit_polygon_tir_imagery',
87 'observation_unit_polygon_bw_background_removed_threshold_imagery',
88 'observation_unit_polygon_rgb_background_removed_threshold_imagery_channel_1',
89 'observation_unit_polygon_rgb_background_removed_threshold_imagery_channel_2',
90 'observation_unit_polygon_rgb_background_removed_threshold_imagery_channel_3',
91 'observation_unit_polygon_blue_background_removed_threshold_imagery',
92 'observation_unit_polygon_green_background_removed_threshold_imagery',
93 'observation_unit_polygon_red_background_removed_threshold_imagery',
94 'observation_unit_polygon_red_edge_background_removed_threshold_imagery',
95 'observation_unit_polygon_nir_background_removed_threshold_imagery',
96 'observation_unit_polygon_mir_background_removed_threshold_imagery',
97 'observation_unit_polygon_fir_background_removed_threshold_imagery',
98 'observation_unit_polygon_tir_background_removed_threshold_imagery',
99 'observation_unit_polygon_tgi_imagery',
100 'observation_unit_polygon_vari_imagery',
101 'observation_unit_polygon_ndvi_imagery',
102 'observation_unit_polygon_ndre_imagery',
103 'observation_unit_polygon_background_removed_tgi_imagery',
104 'observation_unit_polygon_background_removed_vari_imagery',
105 'observation_unit_polygon_background_removed_ndvi_imagery',
106 'observation_unit_polygon_background_removed_ndre_imagery',
107 'observation_unit_polygon_original_background_removed_tgi_mask_imagery',
108 'observation_unit_polygon_original_background_removed_tgi_mask_imagery_channel_1',
109 'observation_unit_polygon_original_background_removed_tgi_mask_imagery_channel_2',
110 'observation_unit_polygon_original_background_removed_tgi_mask_imagery_channel_3',
111 'observation_unit_polygon_original_background_removed_vari_mask_imagery',
112 'observation_unit_polygon_original_background_removed_vari_mask_imagery_channel_1',
113 'observation_unit_polygon_original_background_removed_vari_mask_imagery_channel_2',
114 'observation_unit_polygon_original_background_removed_vari_mask_imagery_channel_3',
115 'observation_unit_polygon_original_nrn_background_removed_ndvi_mask_imagery',
116 'observation_unit_polygon_original_nrn_background_removed_ndvi_mask_imagery_channel_1',
117 'observation_unit_polygon_original_nrn_background_removed_ndvi_mask_imagery_channel_2',
118 'observation_unit_polygon_original_nren_background_removed_ndre_mask_imagery',
119 'observation_unit_polygon_original_nren_background_removed_ndre_mask_imagery_channel_1',
120 'observation_unit_polygon_original_nren_background_removed_ndre_mask_imagery_channel_2',
121 'observation_unit_polygon_original_background_removed_thresholded_tgi_mask_imagery',
122 'observation_unit_polygon_original_background_removed_thresholded_tgi_mask_imagery_channel_1',
123 'observation_unit_polygon_original_background_removed_thresholded_tgi_mask_imagery_channel_2',
124 'observation_unit_polygon_original_background_removed_thresholded_tgi_mask_imagery_channel_3',
125 'observation_unit_polygon_original_background_removed_thresholded_vari_mask_imagery',
126 'observation_unit_polygon_original_background_removed_thresholded_vari_mask_imagery_channel_1',
127 'observation_unit_polygon_original_background_removed_thresholded_vari_mask_imagery_channel_2',
128 'observation_unit_polygon_original_background_removed_thresholded_vari_mask_imagery_channel_3',
129 'observation_unit_polygon_original_nrn_background_removed_thresholded_ndvi_mask_imagery',
130 'observation_unit_polygon_original_nrn_background_removed_thresholded_ndvi_mask_imagery_channel_1',
131 'observation_unit_polygon_original_nrn_background_removed_thresholded_ndvi_mask_imagery_channel_2',
132 'observation_unit_polygon_original_nren_background_removed_thresholded_ndre_mask_imagery',
133 'observation_unit_polygon_original_nren_background_removed_thresholded_ndre_mask_imagery_channel_1',
134 'observation_unit_polygon_original_nren_background_removed_thresholded_ndre_mask_imagery_channel_2',
135 'observation_unit_polygon_fourier_transform_hpf20_bgr_denoised_stitched_image_channel_1',
136 'observation_unit_polygon_fourier_transform_hpf30_bgr_denoised_stitched_image_channel_1',
137 'observation_unit_polygon_fourier_transform_hpf40_bgr_denoised_stitched_image_channel_1',
138 'observation_unit_polygon_fourier_transform_hpf20_bgr_denoised_stitched_image_channel_2',
139 'observation_unit_polygon_fourier_transform_hpf30_bgr_denoised_stitched_image_channel_2',
140 'observation_unit_polygon_fourier_transform_hpf40_bgr_denoised_stitched_image_channel_2',
141 'observation_unit_polygon_fourier_transform_hpf20_bgr_denoised_stitched_image_channel_3',
142 'observation_unit_polygon_fourier_transform_hpf30_bgr_denoised_stitched_image_channel_3',
143 'observation_unit_polygon_fourier_transform_hpf40_bgr_denoised_stitched_image_channel_3',
144 'observation_unit_polygon_fourier_transform_hpf20_bw_denoised_stitched_image_channel_1',
145 'observation_unit_polygon_fourier_transform_hpf30_bw_denoised_stitched_image_channel_1',
146 'observation_unit_polygon_fourier_transform_hpf40_bw_denoised_stitched_image_channel_1',
147 'observation_unit_polygon_fourier_transform_hpf20_blue_denoised_stitched_image_channel_1',
148 'observation_unit_polygon_fourier_transform_hpf30_blue_denoised_stitched_image_channel_1',
149 'observation_unit_polygon_fourier_transform_hpf40_blue_denoised_stitched_image_channel_1',
150 'observation_unit_polygon_fourier_transform_hpf20_green_denoised_stitched_image_channel_1',
151 'observation_unit_polygon_fourier_transform_hpf30_green_denoised_stitched_image_channel_1',
152 'observation_unit_polygon_fourier_transform_hpf40_green_denoised_stitched_image_channel_1',
153 'observation_unit_polygon_fourier_transform_hpf20_red_denoised_stitched_image_channel_1',
154 'observation_unit_polygon_fourier_transform_hpf30_red_denoised_stitched_image_channel_1',
155 'observation_unit_polygon_fourier_transform_hpf40_red_denoised_stitched_image_channel_1',
156 'observation_unit_polygon_fourier_transform_hpf20_rededge_denoised_stitched_image_channel_1',
157 'observation_unit_polygon_fourier_transform_hpf30_rededge_denoised_stitched_image_channel_1',
158 'observation_unit_polygon_fourier_transform_hpf40_rededge_denoised_stitched_image_channel_1',
159 'observation_unit_polygon_fourier_transform_hpf20_nir_denoised_stitched_image_channel_1',
160 'observation_unit_polygon_fourier_transform_hpf30_nir_denoised_stitched_image_channel_1',
161 'observation_unit_polygon_fourier_transform_hpf40_nir_denoised_stitched_image_channel_1',
162 'observation_unit_polygon_fourier_transform_hpf20_mir_denoised_stitched_image_channel_1',
163 'observation_unit_polygon_fourier_transform_hpf30_mir_denoised_stitched_image_channel_1',
164 'observation_unit_polygon_fourier_transform_hpf40_mir_denoised_stitched_image_channel_1',
165 'observation_unit_polygon_fourier_transform_hpf20_fir_denoised_stitched_image_channel_1',
166 'observation_unit_polygon_fourier_transform_hpf30_fir_denoised_stitched_image_channel_1',
167 'observation_unit_polygon_fourier_transform_hpf40_fir_denoised_stitched_image_channel_1',
168 'observation_unit_polygon_fourier_transform_hpf20_tir_denoised_stitched_image_channel_1',
169 'observation_unit_polygon_fourier_transform_hpf30_tir_denoised_stitched_image_channel_1',
170 'observation_unit_polygon_fourier_transform_hpf40_tir_denoised_stitched_image_channel_1',
171 'observation_unit_polygon_fourier_transform_hpf20_bgr_calculate_tgi_drone_imagery_channel_1',
172 'observation_unit_polygon_fourier_transform_hpf30_bgr_calculate_tgi_drone_imagery_channel_1',
173 'observation_unit_polygon_fourier_transform_hpf40_bgr_calculate_tgi_drone_imagery_channel_1',
174 'observation_unit_polygon_fourier_transform_hpf20_bgr_calculate_vari_drone_imagery_channel_1',
175 'observation_unit_polygon_fourier_transform_hpf30_bgr_calculate_vari_drone_imagery_channel_1',
176 'observation_unit_polygon_fourier_transform_hpf40_bgr_calculate_vari_drone_imagery_channel_1',
177 'observation_unit_polygon_fourier_transform_hpf20_nrn_calculate_ndvi_drone_imagery_channel_1',
178 'observation_unit_polygon_fourier_transform_hpf30_nrn_calculate_ndvi_drone_imagery_channel_1',
179 'observation_unit_polygon_fourier_transform_hpf40_nrn_calculate_ndvi_drone_imagery_channel_1',
180 'observation_unit_polygon_fourier_transform_hpf20_nren_calculate_ndre_drone_imagery_channel_1',
181 'observation_unit_polygon_fourier_transform_hpf30_nren_calculate_ndre_drone_imagery_channel_1',
182 'observation_unit_polygon_fourier_transform_hpf40_nren_calculate_ndre_drone_imagery_channel_1',
183 'observation_unit_polygon_fourier_transform_hpf20_bgr_calculate_thresholded_tgi_drone_imagery_channel_1',
184 'observation_unit_polygon_fourier_transform_hpf30_bgr_calculate_thresholded_tgi_drone_imagery_channel_1',
185 'observation_unit_polygon_fourier_transform_hpf40_bgr_calculate_thresholded_tgi_drone_imagery_channel_1',
186 'observation_unit_polygon_fourier_transform_hpf20_bgr_calculate_thresholded_vari_drone_imagery_channel_1',
187 'observation_unit_polygon_fourier_transform_hpf30_bgr_calculate_thresholded_vari_drone_imagery_channel_1',
188 'observation_unit_polygon_fourier_transform_hpf40_bgr_calculate_thresholded_vari_drone_imagery_channel_1',
189 'observation_unit_polygon_fourier_transform_hpf20_nrn_calculate_thresholded_ndvi_drone_imagery_channel_1',
190 'observation_unit_polygon_fourier_transform_hpf30_nrn_calculate_thresholded_ndvi_drone_imagery_channel_1',
191 'observation_unit_polygon_fourier_transform_hpf40_nrn_calculate_thresholded_ndvi_drone_imagery_channel_1',
192 'observation_unit_polygon_fourier_transform_hpf20_nren_calculate_thresholded_ndre_drone_imagery_channel_1',
193 'observation_unit_polygon_fourier_transform_hpf30_nren_calculate_thresholded_ndre_drone_imagery_channel_1',
194 'observation_unit_polygon_fourier_transform_hpf40_nren_calculate_thresholded_ndre_drone_imagery_channel_1',
195 'observation_unit_polygon_fourier_transform_hpf20_bgr_denoised_background_threshold_removed_image_channel_1',
196 'observation_unit_polygon_fourier_transform_hpf30_bgr_denoised_background_threshold_removed_image_channel_1',
197 'observation_unit_polygon_fourier_transform_hpf40_bgr_denoised_background_threshold_removed_image_channel_1',
198 'observation_unit_polygon_fourier_transform_hpf20_bgr_denoised_background_threshold_removed_image_channel_2',
199 'observation_unit_polygon_fourier_transform_hpf30_bgr_denoised_background_threshold_removed_image_channel_2',
200 'observation_unit_polygon_fourier_transform_hpf40_bgr_denoised_background_threshold_removed_image_channel_2',
201 'observation_unit_polygon_fourier_transform_hpf20_bgr_denoised_background_threshold_removed_image_channel_3',
202 'observation_unit_polygon_fourier_transform_hpf30_bgr_denoised_background_threshold_removed_image_channel_3',
203 'observation_unit_polygon_fourier_transform_hpf40_bgr_denoised_background_threshold_removed_image_channel_3',
204 'observation_unit_polygon_fourier_transform_hpf20_blue_denoised_background_threshold_removed_image_channel_1',
205 'observation_unit_polygon_fourier_transform_hpf30_blue_denoised_background_threshold_removed_image_channel_1',
206 'observation_unit_polygon_fourier_transform_hpf40_blue_denoised_background_threshold_removed_image_channel_1',
207 'observation_unit_polygon_fourier_transform_hpf20_bw_denoised_background_threshold_removed_image_channel_1',
208 'observation_unit_polygon_fourier_transform_hpf30_bw_denoised_background_threshold_removed_image_channel_1',
209 'observation_unit_polygon_fourier_transform_hpf40_bw_denoised_background_threshold_removed_image_channel_1',
210 'observation_unit_polygon_fourier_transform_hpf20_green_denoised_background_threshold_removed_image_channel_1',
211 'observation_unit_polygon_fourier_transform_hpf30_green_denoised_background_threshold_removed_image_channel_1',
212 'observation_unit_polygon_fourier_transform_hpf40_green_denoised_background_threshold_removed_image_channel_1',
213 'observation_unit_polygon_fourier_transform_hpf20_red_denoised_background_threshold_removed_image_channel_1',
214 'observation_unit_polygon_fourier_transform_hpf30_red_denoised_background_threshold_removed_image_channel_1',
215 'observation_unit_polygon_fourier_transform_hpf40_red_denoised_background_threshold_removed_image_channel_1',
216 'observation_unit_polygon_fourier_transform_hpf20_rededge_denoised_background_threshold_removed_image_channel_1',
217 'observation_unit_polygon_fourier_transform_hpf30_rededge_denoised_background_threshold_removed_image_channel_1',
218 'observation_unit_polygon_fourier_transform_hpf40_rededge_denoised_background_threshold_removed_image_channel_1',
219 'observation_unit_polygon_fourier_transform_hpf20_nir_denoised_background_threshold_removed_image_channel_1',
220 'observation_unit_polygon_fourier_transform_hpf30_nir_denoised_background_threshold_removed_image_channel_1',
221 'observation_unit_polygon_fourier_transform_hpf40_nir_denoised_background_threshold_removed_image_channel_1',
222 'observation_unit_polygon_fourier_transform_hpf20_mir_denoised_background_threshold_removed_image_channel_1',
223 'observation_unit_polygon_fourier_transform_hpf30_mir_denoised_background_threshold_removed_image_channel_1',
224 'observation_unit_polygon_fourier_transform_hpf40_mir_denoised_background_threshold_removed_image_channel_1',
225 'observation_unit_polygon_fourier_transform_hpf20_fir_denoised_background_threshold_removed_image_channel_1',
226 'observation_unit_polygon_fourier_transform_hpf30_fir_denoised_background_threshold_removed_image_channel_1',
227 'observation_unit_polygon_fourier_transform_hpf40_fir_denoised_background_threshold_removed_image_channel_1',
228 'observation_unit_polygon_fourier_transform_hpf20_tir_denoised_background_threshold_removed_image_channel_1',
229 'observation_unit_polygon_fourier_transform_hpf30_tir_denoised_background_threshold_removed_image_channel_1',
230 'observation_unit_polygon_fourier_transform_hpf40_tir_denoised_background_threshold_removed_image_channel_1',
231 'observation_unit_polygon_fourier_transform_hpf20_bgr_denoised_background_removed_tgi_mask_channel_1',
232 'observation_unit_polygon_fourier_transform_hpf30_bgr_denoised_background_removed_tgi_mask_channel_1',
233 'observation_unit_polygon_fourier_transform_hpf40_bgr_denoised_background_removed_tgi_mask_channel_1',
234 'observation_unit_polygon_fourier_transform_hpf20_bgr_denoised_background_removed_tgi_mask_channel_2',
235 'observation_unit_polygon_fourier_transform_hpf30_bgr_denoised_background_removed_tgi_mask_channel_2',
236 'observation_unit_polygon_fourier_transform_hpf40_bgr_denoised_background_removed_tgi_mask_channel_2',
237 'observation_unit_polygon_fourier_transform_hpf20_bgr_denoised_background_removed_tgi_mask_channel_3',
238 'observation_unit_polygon_fourier_transform_hpf30_bgr_denoised_background_removed_tgi_mask_channel_3',
239 'observation_unit_polygon_fourier_transform_hpf40_bgr_denoised_background_removed_tgi_mask_channel_3',
240 'observation_unit_polygon_fourier_transform_hpf20_bgr_denoised_background_removed_thresholded_tgi_mask_channel_1',
241 'observation_unit_polygon_fourier_transform_hpf30_bgr_denoised_background_removed_thresholded_tgi_mask_channel_1',
242 'observation_unit_polygon_fourier_transform_hpf40_bgr_denoised_background_removed_thresholded_tgi_mask_channel_1',
243 'observation_unit_polygon_fourier_transform_hpf20_bgr_denoised_background_removed_thresholded_tgi_mask_channel_2',
244 'observation_unit_polygon_fourier_transform_hpf30_bgr_denoised_background_removed_thresholded_tgi_mask_channel_2',
245 'observation_unit_polygon_fourier_transform_hpf40_bgr_denoised_background_removed_thresholded_tgi_mask_channel_2',
246 'observation_unit_polygon_fourier_transform_hpf20_bgr_denoised_background_removed_thresholded_tgi_mask_channel_3',
247 'observation_unit_polygon_fourier_transform_hpf30_bgr_denoised_background_removed_thresholded_tgi_mask_channel_3',
248 'observation_unit_polygon_fourier_transform_hpf40_bgr_denoised_background_removed_thresholded_tgi_mask_channel_3',
249 'observation_unit_polygon_fourier_transform_hpf20_bgr_denoised_background_removed_vari_mask_channel_1',
250 'observation_unit_polygon_fourier_transform_hpf30_bgr_denoised_background_removed_vari_mask_channel_1',
251 'observation_unit_polygon_fourier_transform_hpf40_bgr_denoised_background_removed_vari_mask_channel_1',
252 'observation_unit_polygon_fourier_transform_hpf20_bgr_denoised_background_removed_vari_mask_channel_2',
253 'observation_unit_polygon_fourier_transform_hpf30_bgr_denoised_background_removed_vari_mask_channel_2',
254 'observation_unit_polygon_fourier_transform_hpf40_bgr_denoised_background_removed_vari_mask_channel_2',
255 'observation_unit_polygon_fourier_transform_hpf20_bgr_denoised_background_removed_vari_mask_channel_3',
256 'observation_unit_polygon_fourier_transform_hpf30_bgr_denoised_background_removed_vari_mask_channel_3',
257 'observation_unit_polygon_fourier_transform_hpf40_bgr_denoised_background_removed_vari_mask_channel_3',
258 'observation_unit_polygon_fourier_transform_hpf20_bgr_denoised_background_removed_thresholded_vari_mask_channel_1',
259 'observation_unit_polygon_fourier_transform_hpf30_bgr_denoised_background_removed_thresholded_vari_mask_channel_1',
260 'observation_unit_polygon_fourier_transform_hpf40_bgr_denoised_background_removed_thresholded_vari_mask_channel_1',
261 'observation_unit_polygon_fourier_transform_hpf20_bgr_denoised_background_removed_thresholded_vari_mask_channel_2',
262 'observation_unit_polygon_fourier_transform_hpf30_bgr_denoised_background_removed_thresholded_vari_mask_channel_2',
263 'observation_unit_polygon_fourier_transform_hpf40_bgr_denoised_background_removed_thresholded_vari_mask_channel_2',
264 'observation_unit_polygon_fourier_transform_hpf20_bgr_denoised_background_removed_thresholded_vari_mask_channel_3',
265 'observation_unit_polygon_fourier_transform_hpf30_bgr_denoised_background_removed_thresholded_vari_mask_channel_3',
266 'observation_unit_polygon_fourier_transform_hpf40_bgr_denoised_background_removed_thresholded_vari_mask_channel_3',
267 'observation_unit_polygon_fourier_transform_hpf20_nrn_denoised_background_removed_ndvi_mask_channel_1',
268 'observation_unit_polygon_fourier_transform_hpf30_nrn_denoised_background_removed_ndvi_mask_channel_1',
269 'observation_unit_polygon_fourier_transform_hpf40_nrn_denoised_background_removed_ndvi_mask_channel_1',
270 'observation_unit_polygon_fourier_transform_hpf20_nrn_denoised_background_removed_ndvi_mask_channel_2',
271 'observation_unit_polygon_fourier_transform_hpf30_nrn_denoised_background_removed_ndvi_mask_channel_2',
272 'observation_unit_polygon_fourier_transform_hpf40_nrn_denoised_background_removed_ndvi_mask_channel_2',
273 'observation_unit_polygon_fourier_transform_hpf20_nrn_denoised_background_removed_thresholded_ndvi_mask_channel_1',
274 'observation_unit_polygon_fourier_transform_hpf30_nrn_denoised_background_removed_thresholded_ndvi_mask_channel_1',
275 'observation_unit_polygon_fourier_transform_hpf40_nrn_denoised_background_removed_thresholded_ndvi_mask_channel_1',
276 'observation_unit_polygon_fourier_transform_hpf20_nrn_denoised_background_removed_thresholded_ndvi_mask_channel_2',
277 'observation_unit_polygon_fourier_transform_hpf30_nrn_denoised_background_removed_thresholded_ndvi_mask_channel_2',
278 'observation_unit_polygon_fourier_transform_hpf40_nrn_denoised_background_removed_thresholded_ndvi_mask_channel_2',
279 'observation_unit_polygon_fourier_transform_hpf20_nren_denoised_background_removed_ndre_mask_channel_1',
280 'observation_unit_polygon_fourier_transform_hpf30_nren_denoised_background_removed_ndre_mask_channel_1',
281 'observation_unit_polygon_fourier_transform_hpf40_nren_denoised_background_removed_ndre_mask_channel_1',
282 'observation_unit_polygon_fourier_transform_hpf20_nren_denoised_background_removed_ndre_mask_channel_2',
283 'observation_unit_polygon_fourier_transform_hpf30_nren_denoised_background_removed_ndre_mask_channel_2',
284 'observation_unit_polygon_fourier_transform_hpf40_nren_denoised_background_removed_ndre_mask_channel_2',
285 'observation_unit_polygon_fourier_transform_hpf20_nren_denoised_background_removed_thresholded_ndre_mask_channel_1',
286 'observation_unit_polygon_fourier_transform_hpf30_nren_denoised_background_removed_thresholded_ndre_mask_channel_1',
287 'observation_unit_polygon_fourier_transform_hpf40_nren_denoised_background_removed_thresholded_ndre_mask_channel_1',
288 'observation_unit_polygon_fourier_transform_hpf20_nren_denoised_background_removed_thresholded_ndre_mask_channel_2',
289 'observation_unit_polygon_fourier_transform_hpf30_nren_denoised_background_removed_thresholded_ndre_mask_channel_2',
290 'observation_unit_polygon_fourier_transform_hpf40_nren_denoised_background_removed_thresholded_ndre_mask_channel_2',
291 'threshold_background_removed_stitched_drone_imagery_blue',
292 'threshold_background_removed_stitched_drone_imagery_green',
293 'threshold_background_removed_stitched_drone_imagery_red',
294 'threshold_background_removed_stitched_drone_imagery_red_edge',
295 'threshold_background_removed_stitched_drone_imagery_nir',
296 'threshold_background_removed_stitched_drone_imagery_mir',
297 'threshold_background_removed_stitched_drone_imagery_fir',
298 'threshold_background_removed_stitched_drone_imagery_tir',
299 'threshold_background_removed_stitched_drone_imagery_bw',
300 'threshold_background_removed_stitched_drone_imagery_rgb_channel_1',
301 'threshold_background_removed_stitched_drone_imagery_rgb_channel_2',
302 'threshold_background_removed_stitched_drone_imagery_rgb_channel_3',
303 'threshold_background_removed_temporary_stitched_drone_imagery',
304 'threshold_background_removed_tgi_stitched_drone_imagery',
305 'threshold_background_removed_vari_stitched_drone_imagery',
306 'threshold_background_removed_ndvi_stitched_drone_imagery',
307 'threshold_background_removed_ndre_stitched_drone_imagery',
308 'denoised_background_removed_tgi_mask_original',
309 'denoised_background_removed_vari_mask_original',
310 'denoised_background_removed_ndvi_mask_original',
311 'denoised_background_removed_ndre_mask_original',
312 'denoised_background_removed_thresholded_tgi_mask_original',
313 'denoised_background_removed_thresholded_vari_mask_original',
314 'denoised_background_removed_thresholded_ndvi_mask_original',
315 'denoised_background_removed_thresholded_ndre_mask_original',
316 'calculate_phenotypes_sift_drone_imagery',
317 'calculate_phenotypes_sift_drone_imagery_tgi',
318 'calculate_phenotypes_sift_drone_imagery_vari',
319 'calculate_phenotypes_sift_drone_imagery_ndvi',
320 'calculate_phenotypes_sift_drone_imagery_ndre',
321 'calculate_phenotypes_orb_drone_imagery',
322 'calculate_phenotypes_orb_drone_imagery_tgi',
323 'calculate_phenotypes_orb_drone_imagery_vari',
324 'calculate_phenotypes_orb_drone_imagery_ndvi',
325 'calculate_phenotypes_orb_drone_imagery_ndre',
326 'calculate_phenotypes_surf_drone_imagery',
327 'calculate_phenotypes_surf_drone_imagery_tgi',
328 'calculate_phenotypes_surf_drone_imagery_vari',
329 'calculate_phenotypes_surf_drone_imagery_ndvi',
330 'calculate_phenotypes_surf_drone_imagery_ndre',
331 'calculate_phenotypes_fourier_transform_drone_imagery',
332 'calculate_tgi_drone_imagery',
333 'calculate_tgi_temporary_drone_imagery',
334 'calculate_vari_drone_imagery',
335 'calculate_vari_temporary_drone_imagery',
336 'calculate_ndvi_drone_imagery',
337 'calculate_ndvi_temporary_drone_imagery',
338 'calculate_ndre_drone_imagery',
339 'calculate_ndre_temporary_drone_imagery',
340 'calculate_fourier_transform_hpf20_bgr_denoised_stitched_image_channel_1',
341 'calculate_fourier_transform_hpf30_bgr_denoised_stitched_image_channel_1',
342 'calculate_fourier_transform_hpf40_bgr_denoised_stitched_image_channel_1',
343 'calculate_fourier_transform_hpf20_bgr_denoised_stitched_image_channel_2',
344 'calculate_fourier_transform_hpf30_bgr_denoised_stitched_image_channel_2',
345 'calculate_fourier_transform_hpf40_bgr_denoised_stitched_image_channel_2',
346 'calculate_fourier_transform_hpf20_bgr_denoised_stitched_image_channel_3',
347 'calculate_fourier_transform_hpf30_bgr_denoised_stitched_image_channel_3',
348 'calculate_fourier_transform_hpf40_bgr_denoised_stitched_image_channel_3',
349 'calculate_fourier_transform_hpf20_blue_denoised_stitched_image_channel_1',
350 'calculate_fourier_transform_hpf30_blue_denoised_stitched_image_channel_1',
351 'calculate_fourier_transform_hpf40_blue_denoised_stitched_image_channel_1',
352 'calculate_fourier_transform_hpf20_green_denoised_stitched_image_channel_1',
353 'calculate_fourier_transform_hpf30_green_denoised_stitched_image_channel_1',
354 'calculate_fourier_transform_hpf40_green_denoised_stitched_image_channel_1',
355 'calculate_fourier_transform_hpf20_red_denoised_stitched_image_channel_1',
356 'calculate_fourier_transform_hpf30_red_denoised_stitched_image_channel_1',
357 'calculate_fourier_transform_hpf40_red_denoised_stitched_image_channel_1',
358 'calculate_fourier_transform_hpf20_rededge_denoised_stitched_image_channel_1',
359 'calculate_fourier_transform_hpf30_rededge_denoised_stitched_image_channel_1',
360 'calculate_fourier_transform_hpf40_rededge_denoised_stitched_image_channel_1',
361 'calculate_fourier_transform_hpf20_nir_denoised_stitched_image_channel_1',
362 'calculate_fourier_transform_hpf30_nir_denoised_stitched_image_channel_1',
363 'calculate_fourier_transform_hpf40_nir_denoised_stitched_image_channel_1',
364 'calculate_fourier_transform_hpf20_mir_denoised_stitched_image_channel_1',
365 'calculate_fourier_transform_hpf30_mir_denoised_stitched_image_channel_1',
366 'calculate_fourier_transform_hpf40_mir_denoised_stitched_image_channel_1',
367 'calculate_fourier_transform_hpf20_fir_denoised_stitched_image_channel_1',
368 'calculate_fourier_transform_hpf30_fir_denoised_stitched_image_channel_1',
369 'calculate_fourier_transform_hpf40_fir_denoised_stitched_image_channel_1',
370 'calculate_fourier_transform_hpf20_tir_denoised_stitched_image_channel_1',
371 'calculate_fourier_transform_hpf30_tir_denoised_stitched_image_channel_1',
372 'calculate_fourier_transform_hpf40_tir_denoised_stitched_image_channel_1',
373 'calculate_fourier_transform_hpf20_bw_denoised_stitched_image_channel_1',
374 'calculate_fourier_transform_hpf30_bw_denoised_stitched_image_channel_1',
375 'calculate_fourier_transform_hpf40_bw_denoised_stitched_image_channel_1',
376 'calculate_fourier_transform_hpf20_blue_threshold_background_removed_stitched_drone_imagery_channel_1',
377 'calculate_fourier_transform_hpf30_blue_threshold_background_removed_stitched_drone_imagery_channel_1',
378 'calculate_fourier_transform_hpf40_blue_threshold_background_removed_stitched_drone_imagery_channel_1',
379 'calculate_fourier_transform_hpf20_green_threshold_background_removed_stitched_drone_imagery_channel_1',
380 'calculate_fourier_transform_hpf30_green_threshold_background_removed_stitched_drone_imagery_channel_1',
381 'calculate_fourier_transform_hpf40_green_threshold_background_removed_stitched_drone_imagery_channel_1',
382 'calculate_fourier_transform_hpf20_red_threshold_background_removed_stitched_drone_imagery_channel_1',
383 'calculate_fourier_transform_hpf30_red_threshold_background_removed_stitched_drone_imagery_channel_1',
384 'calculate_fourier_transform_hpf40_red_threshold_background_removed_stitched_drone_imagery_channel_1',
385 'calculate_fourier_transform_hpf20_rededge_threshold_background_removed_stitched_drone_imagery_channel_1',
386 'calculate_fourier_transform_hpf30_rededge_threshold_background_removed_stitched_drone_imagery_channel_1',
387 'calculate_fourier_transform_hpf40_rededge_threshold_background_removed_stitched_drone_imagery_channel_1',
388 'calculate_fourier_transform_hpf20_nir_threshold_background_removed_stitched_drone_imagery_channel_1',
389 'calculate_fourier_transform_hpf30_nir_threshold_background_removed_stitched_drone_imagery_channel_1',
390 'calculate_fourier_transform_hpf40_nir_threshold_background_removed_stitched_drone_imagery_channel_1',
391 'calculate_fourier_transform_hpf20_mir_threshold_background_removed_stitched_drone_imagery_channel_1',
392 'calculate_fourier_transform_hpf30_mir_threshold_background_removed_stitched_drone_imagery_channel_1',
393 'calculate_fourier_transform_hpf40_mir_threshold_background_removed_stitched_drone_imagery_channel_1',
394 'calculate_fourier_transform_hpf20_fir_threshold_background_removed_stitched_drone_imagery_channel_1',
395 'calculate_fourier_transform_hpf30_fir_threshold_background_removed_stitched_drone_imagery_channel_1',
396 'calculate_fourier_transform_hpf40_fir_threshold_background_removed_stitched_drone_imagery_channel_1',
397 'calculate_fourier_transform_hpf20_tir_threshold_background_removed_stitched_drone_imagery_channel_1',
398 'calculate_fourier_transform_hpf30_tir_threshold_background_removed_stitched_drone_imagery_channel_1',
399 'calculate_fourier_transform_hpf40_tir_threshold_background_removed_stitched_drone_imagery_channel_1',
400 'calculate_fourier_transform_hpf20_bw_threshold_background_removed_stitched_drone_imagery_channel_1',
401 'calculate_fourier_transform_hpf30_bw_threshold_background_removed_stitched_drone_imagery_channel_1',
402 'calculate_fourier_transform_hpf40_bw_threshold_background_removed_stitched_drone_imagery_channel_1',
403 'calculate_fourier_transform_hpf20_bgr_threshold_background_removed_stitched_drone_imagery_channel_1',
404 'calculate_fourier_transform_hpf30_bgr_threshold_background_removed_stitched_drone_imagery_channel_1',
405 'calculate_fourier_transform_hpf40_bgr_threshold_background_removed_stitched_drone_imagery_channel_1',
406 'calculate_fourier_transform_hpf20_bgr_threshold_background_removed_stitched_drone_imagery_channel_2',
407 'calculate_fourier_transform_hpf30_bgr_threshold_background_removed_stitched_drone_imagery_channel_2',
408 'calculate_fourier_transform_hpf40_bgr_threshold_background_removed_stitched_drone_imagery_channel_2',
409 'calculate_fourier_transform_hpf20_bgr_threshold_background_removed_stitched_drone_imagery_channel_3',
410 'calculate_fourier_transform_hpf30_bgr_threshold_background_removed_stitched_drone_imagery_channel_3',
411 'calculate_fourier_transform_hpf40_bgr_threshold_background_removed_stitched_drone_imagery_channel_3',
412 'calculate_fourier_transform_hpf20_bgr_threshold_background_removed_tgi_stitched_drone_imagery_channel_1',
413 'calculate_fourier_transform_hpf30_bgr_threshold_background_removed_tgi_stitched_drone_imagery_channel_1',
414 'calculate_fourier_transform_hpf40_bgr_threshold_background_removed_tgi_stitched_drone_imagery_channel_1',
415 'calculate_fourier_transform_hpf20_bgr_threshold_background_removed_vari_stitched_drone_imagery_channel_1',
416 'calculate_fourier_transform_hpf30_bgr_threshold_background_removed_vari_stitched_drone_imagery_channel_1',
417 'calculate_fourier_transform_hpf40_bgr_threshold_background_removed_vari_stitched_drone_imagery_channel_1',
418 'calculate_fourier_transform_hpf20_nrn_threshold_background_removed_ndvi_stitched_drone_imagery_channel_1',
419 'calculate_fourier_transform_hpf30_nrn_threshold_background_removed_ndvi_stitched_drone_imagery_channel_1',
420 'calculate_fourier_transform_hpf40_nrn_threshold_background_removed_ndvi_stitched_drone_imagery_channel_1',
421 'calculate_fourier_transform_hpf20_nren_threshold_background_removed_ndre_stitched_drone_imagery_channel_1',
422 'calculate_fourier_transform_hpf30_nren_threshold_background_removed_ndre_stitched_drone_imagery_channel_1',
423 'calculate_fourier_transform_hpf40_nren_threshold_background_removed_ndre_stitched_drone_imagery_channel_1',
424 'calculate_fourier_transform_hpf20_bgr_denoised_background_removed_tgi_mask_original_channel_1',
425 'calculate_fourier_transform_hpf30_bgr_denoised_background_removed_tgi_mask_original_channel_1',
426 'calculate_fourier_transform_hpf40_bgr_denoised_background_removed_tgi_mask_original_channel_1',
427 'calculate_fourier_transform_hpf20_bgr_denoised_background_removed_tgi_mask_original_channel_2',
428 'calculate_fourier_transform_hpf30_bgr_denoised_background_removed_tgi_mask_original_channel_2',
429 'calculate_fourier_transform_hpf40_bgr_denoised_background_removed_tgi_mask_original_channel_2',
430 'calculate_fourier_transform_hpf20_bgr_denoised_background_removed_tgi_mask_original_channel_3',
431 'calculate_fourier_transform_hpf30_bgr_denoised_background_removed_tgi_mask_original_channel_3',
432 'calculate_fourier_transform_hpf40_bgr_denoised_background_removed_tgi_mask_original_channel_3',
433 'calculate_fourier_transform_hpf20_bgr_denoised_background_removed_vari_mask_original_channel_1',
434 'calculate_fourier_transform_hpf30_bgr_denoised_background_removed_vari_mask_original_channel_1',
435 'calculate_fourier_transform_hpf40_bgr_denoised_background_removed_vari_mask_original_channel_1',
436 'calculate_fourier_transform_hpf20_bgr_denoised_background_removed_vari_mask_original_channel_2',
437 'calculate_fourier_transform_hpf30_bgr_denoised_background_removed_vari_mask_original_channel_2',
438 'calculate_fourier_transform_hpf40_bgr_denoised_background_removed_vari_mask_original_channel_2',
439 'calculate_fourier_transform_hpf20_bgr_denoised_background_removed_vari_mask_original_channel_3',
440 'calculate_fourier_transform_hpf30_bgr_denoised_background_removed_vari_mask_original_channel_3',
441 'calculate_fourier_transform_hpf40_bgr_denoised_background_removed_vari_mask_original_channel_3',
442 'calculate_fourier_transform_hpf20_nrn_denoised_background_removed_ndvi_mask_original_channel_1',
443 'calculate_fourier_transform_hpf30_nrn_denoised_background_removed_ndvi_mask_original_channel_1',
444 'calculate_fourier_transform_hpf40_nrn_denoised_background_removed_ndvi_mask_original_channel_1',
445 'calculate_fourier_transform_hpf20_nrn_denoised_background_removed_ndvi_mask_original_channel_2',
446 'calculate_fourier_transform_hpf30_nrn_denoised_background_removed_ndvi_mask_original_channel_2',
447 'calculate_fourier_transform_hpf40_nrn_denoised_background_removed_ndvi_mask_original_channel_2',
448 'calculate_fourier_transform_hpf20_nren_denoised_background_removed_ndre_mask_original_channel_1',
449 'calculate_fourier_transform_hpf30_nren_denoised_background_removed_ndre_mask_original_channel_1',
450 'calculate_fourier_transform_hpf40_nren_denoised_background_removed_ndre_mask_original_channel_1',
451 'calculate_fourier_transform_hpf20_nren_denoised_background_removed_ndre_mask_original_channel_2',
452 'calculate_fourier_transform_hpf30_nren_denoised_background_removed_ndre_mask_original_channel_2',
453 'calculate_fourier_transform_hpf40_nren_denoised_background_removed_ndre_mask_original_channel_2',
454 'calculate_fourier_transform_hpf20_bgr_denoised_background_removed_thresholded_tgi_mask_original_channel_1',
455 'calculate_fourier_transform_hpf30_bgr_denoised_background_removed_thresholded_tgi_mask_original_channel_1',
456 'calculate_fourier_transform_hpf40_bgr_denoised_background_removed_thresholded_tgi_mask_original_channel_1',
457 'calculate_fourier_transform_hpf20_bgr_denoised_background_removed_thresholded_tgi_mask_original_channel_2',
458 'calculate_fourier_transform_hpf30_bgr_denoised_background_removed_thresholded_tgi_mask_original_channel_2',
459 'calculate_fourier_transform_hpf40_bgr_denoised_background_removed_thresholded_tgi_mask_original_channel_2',
460 'calculate_fourier_transform_hpf20_bgr_denoised_background_removed_thresholded_tgi_mask_original_channel_3',
461 'calculate_fourier_transform_hpf30_bgr_denoised_background_removed_thresholded_tgi_mask_original_channel_3',
462 'calculate_fourier_transform_hpf40_bgr_denoised_background_removed_thresholded_tgi_mask_original_channel_3',
463 'calculate_fourier_transform_hpf20_bgr_denoised_background_removed_thresholded_vari_mask_original_channel_1',
464 'calculate_fourier_transform_hpf30_bgr_denoised_background_removed_thresholded_vari_mask_original_channel_1',
465 'calculate_fourier_transform_hpf40_bgr_denoised_background_removed_thresholded_vari_mask_original_channel_1',
466 'calculate_fourier_transform_hpf20_bgr_denoised_background_removed_thresholded_vari_mask_original_channel_2',
467 'calculate_fourier_transform_hpf30_bgr_denoised_background_removed_thresholded_vari_mask_original_channel_2',
468 'calculate_fourier_transform_hpf40_bgr_denoised_background_removed_thresholded_vari_mask_original_channel_2',
469 'calculate_fourier_transform_hpf20_bgr_denoised_background_removed_thresholded_vari_mask_original_channel_3',
470 'calculate_fourier_transform_hpf30_bgr_denoised_background_removed_thresholded_vari_mask_original_channel_3',
471 'calculate_fourier_transform_hpf40_bgr_denoised_background_removed_thresholded_vari_mask_original_channel_3',
472 'calculate_fourier_transform_hpf20_nrn_denoised_background_removed_thresholded_ndvi_mask_original_channel_1',
473 'calculate_fourier_transform_hpf30_nrn_denoised_background_removed_thresholded_ndvi_mask_original_channel_1',
474 'calculate_fourier_transform_hpf40_nrn_denoised_background_removed_thresholded_ndvi_mask_original_channel_1',
475 'calculate_fourier_transform_hpf20_nrn_denoised_background_removed_thresholded_ndvi_mask_original_channel_2',
476 'calculate_fourier_transform_hpf30_nrn_denoised_background_removed_thresholded_ndvi_mask_original_channel_2',
477 'calculate_fourier_transform_hpf40_nrn_denoised_background_removed_thresholded_ndvi_mask_original_channel_2',
478 'calculate_fourier_transform_hpf20_nren_denoised_background_removed_thresholded_ndre_mask_original_channel_1',
479 'calculate_fourier_transform_hpf30_nren_denoised_background_removed_thresholded_ndre_mask_original_channel_1',
480 'calculate_fourier_transform_hpf40_nren_denoised_background_removed_thresholded_ndre_mask_original_channel_1',
481 'calculate_fourier_transform_hpf20_nren_denoised_background_removed_thresholded_ndre_mask_original_channel_2',
482 'calculate_fourier_transform_hpf30_nren_denoised_background_removed_thresholded_ndre_mask_original_channel_2',
483 'calculate_fourier_transform_hpf40_nren_denoised_background_removed_thresholded_ndre_mask_original_channel_2',
484 'calculate_fourier_transform_hpf20_bgr_calculate_tgi_drone_imagery_channel_1',
485 'calculate_fourier_transform_hpf30_bgr_calculate_tgi_drone_imagery_channel_1',
486 'calculate_fourier_transform_hpf40_bgr_calculate_tgi_drone_imagery_channel_1',
487 'calculate_fourier_transform_hpf20_bgr_calculate_vari_drone_imagery_channel_1',
488 'calculate_fourier_transform_hpf30_bgr_calculate_vari_drone_imagery_channel_1',
489 'calculate_fourier_transform_hpf40_bgr_calculate_vari_drone_imagery_channel_1',
490 'calculate_fourier_transform_hpf20_nrn_calculate_ndvi_drone_imagery_channel_1',
491 'calculate_fourier_transform_hpf30_nrn_calculate_ndvi_drone_imagery_channel_1',
492 'calculate_fourier_transform_hpf40_nrn_calculate_ndvi_drone_imagery_channel_1',
493 'calculate_fourier_transform_hpf20_nren_calculate_ndre_drone_imagery_channel_1',
494 'calculate_fourier_transform_hpf30_nren_calculate_ndre_drone_imagery_channel_1',
495 'calculate_fourier_transform_hpf40_nren_calculate_ndre_drone_imagery_channel_1'
497 'project_property' => [
498 'project_start_date',
499 'drone_run_project_type',
500 'drone_run_camera_type',
501 'drone_run_band_project_type',
502 'drone_run_band_rotate_angle',
503 'drone_run_band_cropped_polygon',
504 'drone_run_band_background_removed_tgi_threshold',
505 'drone_run_band_background_removed_vari_threshold',
506 'drone_run_band_background_removed_ndvi_threshold',
507 'drone_run_band_background_removed_ndre_threshold',
508 'drone_run_band_background_removed_tgi_mask_original_threshold',
509 'drone_run_band_background_removed_vari_mask_original_threshold',
510 'drone_run_band_background_removed_ndvi_mask_original_threshold',
511 'drone_run_band_background_removed_ndre_mask_original_threshold',
512 'drone_run_band_background_removed_thresholded_tgi_mask_original_threshold',
513 'drone_run_band_background_removed_thresholded_vari_mask_original_threshold',
514 'drone_run_band_background_removed_thresholded_ndvi_mask_original_threshold',
515 'drone_run_band_background_removed_thresholded_ndre_mask_original_threshold',
516 'drone_run_band_background_removed_threshold',
517 'drone_run_band_plot_polygons',
518 'drone_run_standard_process_in_progress',
519 'drone_run_standard_process_completed',
520 'drone_run_standard_process_extended_completed',
521 'drone_run_standard_process_vi_completed',
522 'drone_run_standard_process_phenotype_calculation_in_progress'
524 'project_relationship' => [
525 'drone_run_on_field_trial',
526 'drone_run_band_on_drone_run'
530 foreach my $t (keys %$terms){
531 foreach (@{$terms->{$t}}){
532 $schema->resultset("Cv::Cvterm")->create_with({
533 name => $_,
534 cv => $t
539 my $coderef = sub {
540 my $sql = <<SQL;
541 CREATE TABLE if not exists phenome.project_md_image (
542 project_md_image_id serial PRIMARY KEY,
543 project_id integer NOT NULL,
544 image_id integer NOT NULL,
545 type_id integer NOT NULL,
546 constraint project_md_image_project_id_fkey FOREIGN KEY (project_id) REFERENCES project (project_id) MATCH SIMPLE ON UPDATE NO ACTION ON DELETE NO ACTION,
547 constraint project_md_image_image_id_fkey FOREIGN KEY (image_id) REFERENCES metadata.md_image (image_id) MATCH SIMPLE ON UPDATE NO ACTION ON DELETE NO ACTION,
548 constraint project_md_image_type_id_fkey FOREIGN KEY (type_id) REFERENCES cvterm (cvterm_id) MATCH SIMPLE ON UPDATE NO ACTION ON DELETE NO ACTION
550 grant select,insert,delete on table phenome.project_md_image to web_usr;
551 grant usage on phenome.project_md_image_project_md_image_id_seq to web_usr;
553 CREATE TABLE if not exists phenome.nd_experiment_md_images (
554 nd_experiment_md_images_id serial PRIMARY KEY,
555 nd_experiment_id integer NOT NULL,
556 image_id integer NOT NULL,
557 constraint nd_experiment_md_images_nd_experiment_id_fkey FOREIGN KEY (nd_experiment_id) REFERENCES nd_experiment (nd_experiment_id) MATCH SIMPLE ON UPDATE NO ACTION ON DELETE NO ACTION,
558 constraint nd_experiment_md_images_image_id_fkey FOREIGN KEY (image_id) REFERENCES metadata.md_image (image_id) MATCH SIMPLE ON UPDATE NO ACTION ON DELETE NO ACTION
560 grant select,insert,delete on table phenome.nd_experiment_md_images to web_usr;
561 grant usage on phenome.nd_experiment_md_images_nd_experiment_md_images_id_seq to web_usr;
563 ALTER TABLE metadata.md_tag ALTER COLUMN name TYPE varchar(256);
565 $schema->storage->dbh->do($sql);
568 my $transaction_error;
569 try {
570 $schema->txn_do($coderef);
571 } catch {
572 $transaction_error = $_;
574 if ($transaction_error){
575 print STDERR "ERROR: $transaction_error\n";
576 } else {
577 print "You're done!\n";
582 ####
583 1; #
584 ####