Changeset 35227
- Timestamp:
- Mar 4, 2013, 2:08:07 PM (13 years ago)
- Location:
- trunk
- Files:
-
- 5 edited
-
dbconfig/changes.txt (modified) (6 diffs)
-
ippTools/share/pxadmin_create_tables.sql (modified) (6 diffs)
-
ippTools/share/pxadmin_drop_tables.sql (modified) (1 diff)
-
ippTools/src/releasetool.c (modified) (2 diffs)
-
ippTools/src/releasetoolConfig.c (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/dbconfig/changes.txt
r35196 r35227 2272 2272 UPDATE dbversion set schema_version = '1.1.74', updated= CURRENT_TIMESTAMP(); 2273 2273 2274 2275 -- Note the following 3 changes were implemented in the ipp-20121218 tag 2276 -- without changing the schema_version from 1.1.74 2277 2278 -- Add cam_id to chipBackgroundRun 2279 ALTER TABLE chipBackgroundRun ADD COLUMN cam_id BIGINT DEFAULT 0 AFTER chip_id; 2280 2281 -- add fwhm measuements to skycalResult 2282 ALTER TABLE skycalResult ADD COLUMN fwhm_major FLOAT AFTER zpt_stdev; 2283 ALTER TABLE skycalResult ADD COLUMN fwhm_minor FLOAT AFTER fwhm_major; 2284 2274 2285 -- new tables for managing the "release" of ipp data 2275 2286 2276 2287 CREATE TABLE survey ( 2277 surveyID INT (8),2288 surveyID INT, 2278 2289 surveyName VARCHAR(16) NOT NULL, 2279 2290 description VARCHAR(255), … … 2282 2293 ) ENGINE=InnoDB CHARSET=latin1; 2283 2294 2284 2285 2295 CREATE TABLE ippRelease ( 2286 rel_id INT(8) AUTO_INCREMENT, 2287 surveyID INT(8), 2288 releaseName VARCHAR(64), 2289 release_state VARCHAR(16), -- active, pending archive drop 2290 dataRelease INT(8), -- PSPS dataRelease 2296 rel_id INT AUTO_INCREMENT, 2297 surveyID INT, 2298 release_name VARCHAR(64), 2299 release_state VARCHAR(16), -- active, pending, archive, drop 2300 dataRelease INT, -- PSPS dataRelease 2301 priority INT, 2291 2302 PRIMARY KEY(rel_id), 2292 KEY(releaseName), 2293 KEY(state), 2303 KEY(release_name), 2304 KEY(release_state), 2305 KEY(priority), 2294 2306 FOREIGN KEY(surveyID) REFERENCES survey(surveyID) 2295 2307 ) ENGINE=Innodb DEFAULT CHARSET=latin1; … … 2297 2309 CREATE TABLE relExp ( 2298 2310 relexp_id BIGINT AUTO_INCREMENT, 2299 rel_id INT (8),2311 rel_id INT, 2300 2312 exp_id BIGINT, 2301 2313 chip_id BIGINT, -- links to the runs that supplied the data 2302 2314 cam_id BIGINT, -- for this release 2315 group_id INT, -- id of relGroup that this exposure is contained in 2303 2316 state VARCHAR(16), -- released, pending, archive, drop 2304 flags INT UNSIGNED, -- flags for relphot, relastro, ??2317 flags INT UNSIGNED, -- flags for relphot, relastro, ?? 2305 2318 zpt_obs FLOAT, -- calibrated zero point for this release of 2306 2319 zpt_stdev FLOAT, -- this exposure … … 2321 2334 CREATE TABLE relStack ( 2322 2335 relstack_id BIGINT AUTO_INCREMENT, 2323 rel_id INT (8),2336 rel_id INT, 2324 2337 stack_id BIGINT, -- id of the stackRun 2325 2338 skycal_id BIGINT, -- id of the sky calibration run that supplied the calibration … … 2333 2346 zpt_obs FLOAT, -- calibrated zero point for this release of this skycell 2334 2347 zpt_stdev FLOAT, 2335 mjd_obs INT UNSIGNED, -- for nightly stacks the mjd_obs 2348 mjd_obs INT UNSIGNED, -- for nightly stacks the mjd_obs, zero for deep and reference 2336 2349 path_base VARCHAR(255), -- path_base of any supporting files, 2337 2350 fault SMALLINT NOT NULL, … … 2349 2362 ) ENGINE=innodb DEFAULT CHARSET=latin1; 2350 2363 2351 -- Add cam_id to chipBackgroundRun 2352 ALTER TABLE chipBackgroundRun ADD COLUMN cam_id BIGINT DEFAULT 0 AFTER chip_id; 2353 2354 ALTER TABLE skycalResult ADD COLUMN fwhm_major FLOAT AFTER zpt_stdev; 2355 ALTER TABLE skycalResult ADD COLUMN fwhm_minor FLOAT AFTER fwhm_major; 2364 CREATE TABLE relGroup ( 2365 group_id INT AUTO_INCREMENT, 2366 rel_id INT, 2367 group_type VARCHAR(16), 2368 lap_id BIGINT, 2369 group_name VARCHAR(16), 2370 state VARCHAR(16), -- new full 2371 label VARCHAR(64), 2372 exp_list_path VARCHAR(255), 2373 fault SMALLINT NOT NULL, 2374 registered DATETIME, 2375 PRIMARY KEY (group_id), 2376 KEY (rel_id, group_name), 2377 KEY (group_type), 2378 KEY (lap_id), 2379 KEY (group_name), 2380 KEY (state), 2381 KEY (label), 2382 KEY (fault), 2383 FOREIGN KEY(rel_id) REFERENCES ippRelease(rel_id) 2384 ) ENGINE=innodb DEFAULT CHARSET=latin1; 2385 2386 -- new table grouping multi filter lap runs into a group. This is used to 2387 -- determine when all 5 filters for a projection cell have completed processing 2388 CREATE TABLE lapGroup ( 2389 seq_id BIGINT, 2390 projection_cell VARCHAR(64), 2391 state VARCHAR(16), 2392 fault SMALLINT, 2393 PRIMARY KEY(seq_id, projection_cell), 2394 KEY(state), 2395 KEY(fault), 2396 FOREIGN KEY(seq_id) REFERENCES lapSequence(seq_id) 2397 ) ENGINE=innodb DEFAULT CHARSET=latin1; 2356 2398 2357 2399 UPDATE dbversion set schema_version = '1.1.75', updated= CURRENT_TIMESTAMP(); 2400 -
trunk/ippTools/share/pxadmin_create_tables.sql
r35213 r35227 2153 2153 2154 2154 CREATE TABLE survey ( 2155 surveyID INT (8),2155 surveyID INT, 2156 2156 surveyName VARCHAR(16) NOT NULL, 2157 2157 description VARCHAR(255), 2158 2158 PRIMARY KEY(surveyID), 2159 UNIQUE KEY( name)2159 UNIQUE KEY(surveyName) 2160 2160 ) ENGINE=InnoDB CHARSET=latin1; 2161 2161 2162 2163 2162 CREATE TABLE ippRelease ( 2164 rel_id INT (8)AUTO_INCREMENT,2165 surveyID INT (8),2163 rel_id INT AUTO_INCREMENT, 2164 surveyID INT, 2166 2165 release_name VARCHAR(64), 2167 rel ase_state VARCHAR(16), -- active, pending, archive, drop2168 dataRelease INT (8), -- PSPS dataRelease2169 priority INT (8),2166 release_state VARCHAR(16), -- active, pending, archive, drop 2167 dataRelease INT, -- PSPS dataRelease 2168 priority INT, 2170 2169 PRIMARY KEY(rel_id), 2171 2170 KEY(release_name), 2172 KEY( state),2171 KEY(release_state), 2173 2172 KEY(priority), 2174 2173 FOREIGN KEY(surveyID) REFERENCES survey(surveyID) … … 2177 2176 CREATE TABLE relExp ( 2178 2177 relexp_id BIGINT AUTO_INCREMENT, 2179 rel_id INT (8),2178 rel_id INT, 2180 2179 exp_id BIGINT, 2181 2180 chip_id BIGINT, -- links to the runs that supplied the data 2182 2181 cam_id BIGINT, -- for this release 2183 group_id INT (8), -- id of relGroup that this exposure is contained in2182 group_id INT, -- id of relGroup that this exposure is contained in 2184 2183 state VARCHAR(16), -- released, pending, archive, drop 2185 flags INT UNSIGNED, -- flags for relphot, relastro, ??2184 flags INT UNSIGNED, -- flags for relphot, relastro, ?? 2186 2185 zpt_obs FLOAT, -- calibrated zero point for this release of 2187 2186 zpt_stdev FLOAT, -- this exposure … … 2202 2201 CREATE TABLE relStack ( 2203 2202 relstack_id BIGINT AUTO_INCREMENT, 2204 rel_id INT (8),2203 rel_id INT, 2205 2204 stack_id BIGINT, -- id of the stackRun 2206 2205 skycal_id BIGINT, -- id of the sky calibration run that supplied the calibration … … 2214 2213 zpt_obs FLOAT, -- calibrated zero point for this release of this skycell 2215 2214 zpt_stdev FLOAT, 2216 mjd_obs INT UNSIGNED, -- for nightly stacks the mjd_obs 2215 mjd_obs INT UNSIGNED, -- for nightly stacks the mjd_obs, zero for deep and reference 2217 2216 path_base VARCHAR(255), -- path_base of any supporting files, 2218 2217 fault SMALLINT NOT NULL, … … 2231 2230 2232 2231 CREATE TABLE relGroup ( 2233 group_id INT (8)AUTO_INCREMENT,2234 rel_id INT (8),2232 group_id INT AUTO_INCREMENT, 2233 rel_id INT, 2235 2234 group_type VARCHAR(16), 2236 2235 lap_id BIGINT, … … 2252 2251 ) ENGINE=innodb DEFAULT CHARSET=latin1; 2253 2252 2253 CREATE TABLE lapGroup ( 2254 seq_id BIGINT, 2255 projection_cell VARCHAR(64), 2256 state VARCHAR(16), 2257 fault SMALLINT, 2258 PRIMARY KEY(seq_id, projection_cell), 2259 KEY(state), 2260 KEY(fault), 2261 FOREIGN KEY(seq_id) REFERENCES lapSequence(seq_id) 2262 ) ENGINE=innodb DEFAULT CHARSET=latin1; 2263 2254 2264 2255 2265 -
trunk/ippTools/share/pxadmin_drop_tables.sql
r34913 r35227 109 109 DROP TABLE IF EXISTS skycalResult; 110 110 DROP TABLE IF EXISTS skycell; 111 DROP TABLE IF EXISTS relStack; 111 112 DROP TABLE IF EXISTS relExp; 113 DROP TABLE IF EXISTS relGroup; 112 114 DROP TABLE IF EXISTS ippRelease; 113 115 DROP TABLE IF EXISTS survey; 116 DROP TABLE IF EXISTS lapGroup; 114 117 115 118 SET FOREIGN_KEY_CHECKS=1 -
trunk/ippTools/src/releasetool.c
r35214 r35227 214 214 PXOPT_LOOKUP_STR(release_state, config->args, "-set_release_state", false, false); 215 215 PXOPT_LOOKUP_S32(priority, config->args, "-set_priority", false, false); 216 if (!release_state && !priority) { 217 psError(PXTOOLS_ERR_CONFIG, true, "at least one of -set_release_staate and -set_priority is required\n"); 216 PXOPT_LOOKUP_S32(dataRelease, config->args, "-set_dataRelease", false, false); 217 if (!release_state && priority == 0 && dataRelease == -1) { 218 psError(PXTOOLS_ERR_CONFIG, true, "at least one of -set_release_state -set_priority and -set_dataRelease is required\n"); 218 219 return false; 219 220 } … … 233 234 if (priority != 0) { 234 235 psStringAppend(&query, "%s priority = %d", sep, priority); 236 sep = comma; 237 } 238 if (dataRelease != -1) { 239 psStringAppend(&query, "%s dataRelease = %d", sep, dataRelease); 235 240 sep = comma; 236 241 } -
trunk/ippTools/src/releasetoolConfig.c
r35214 r35227 74 74 psMetadataAddStr(updatereleaseArgs, PS_LIST_TAIL, "-set_release_state", 0, "define new release state", NULL); 75 75 psMetadataAddS32(updatereleaseArgs, PS_LIST_TAIL, "-set_priority", 0, "define new release priority", 0); 76 77 // Only support changing state and priority for now 78 // psMetadataAddS32(updatereleaseArgs, PS_LIST_TAIL, "-set_surveyID", 0, "define surveyID (required)", 0); 79 // psMetadataAddStr(updatereleaseArgs, PS_LIST_TAIL, "-set_release_name", 0, "define release name (required)", NULL); 80 // psMetadataAddS32(updatereleaseArgs, PS_LIST_TAIL, "-set_dataRelease", 0, "define dataRelease", -1); 76 psMetadataAddS32(updatereleaseArgs, PS_LIST_TAIL, "-set_dataRelease", 0, "define data release", -1); 81 77 82 78
Note:
See TracChangeset
for help on using the changeset viewer.
