Ticket #1176: sequence_fix.sql

File sequence_fix.sql, 8.4 KB (added by jmoore, 12 years ago)

Attaching an SQL script which will reset all enums until the sequence generators are functioning properly.

Line 
1--
2-- Copyright 2009 Glencoe Software, Inc. All rights reserved.
3-- Use is subject to license terms supplied in LICENSE.txt
4--
5
6BEGIN;
7-- Correcting sequences pre-new generator switch (#1176)
8SELECT setval('seq_acquisitionmode', id) FROM acquisitionmode ORDER BY id DESC LIMIT 1;
9SELECT setval('seq_annotation', id) FROM annotation ORDER BY id DESC LIMIT 1;
10SELECT setval('seq_annotationannotationlink', id) FROM annotationannotationlink ORDER BY id DESC LIMIT 1;
11SELECT setval('seq_arctype', id) FROM arctype ORDER BY id DESC LIMIT 1;
12SELECT setval('seq_binning', id) FROM binning ORDER BY id DESC LIMIT 1;
13SELECT setval('seq_channel', id) FROM channel ORDER BY id DESC LIMIT 1;
14SELECT setval('seq_channelannotationlink', id) FROM channelannotationlink ORDER BY id DESC LIMIT 1;
15SELECT setval('seq_channelbinding', id) FROM channelbinding ORDER BY id DESC LIMIT 1;
16SELECT setval('seq_codomainmapcontext', id) FROM codomainmapcontext ORDER BY id DESC LIMIT 1;
17SELECT setval('seq_contrastmethod', id) FROM contrastmethod ORDER BY id DESC LIMIT 1;
18SELECT setval('seq_correction', id) FROM correction ORDER BY id DESC LIMIT 1;
19SELECT setval('seq_dataset', id) FROM dataset ORDER BY id DESC LIMIT 1;
20SELECT setval('seq_datasetannotationlink', id) FROM datasetannotationlink ORDER BY id DESC LIMIT 1;
21SELECT setval('seq_datasetimagelink', id) FROM datasetimagelink ORDER BY id DESC LIMIT 1;
22SELECT setval('seq_dbpatch', id) FROM dbpatch ORDER BY id DESC LIMIT 1;
23SELECT setval('seq_detector', id) FROM detector ORDER BY id DESC LIMIT 1;
24SELECT setval('seq_detectorsettings', id) FROM detectorsettings ORDER BY id DESC LIMIT 1;
25SELECT setval('seq_detectortype', id) FROM detectortype ORDER BY id DESC LIMIT 1;
26SELECT setval('seq_dichroic', id) FROM dichroic ORDER BY id DESC LIMIT 1;
27SELECT setval('seq_dimensionorder', id) FROM dimensionorder ORDER BY id DESC LIMIT 1;
28SELECT setval('seq_event', id) FROM event ORDER BY id DESC LIMIT 1;
29SELECT setval('seq_eventlog', id) FROM eventlog ORDER BY id DESC LIMIT 1;
30SELECT setval('seq_eventtype', id) FROM eventtype ORDER BY id DESC LIMIT 1;
31SELECT setval('seq_experiment', id) FROM experiment ORDER BY id DESC LIMIT 1;
32SELECT setval('seq_experimenter', id) FROM experimenter ORDER BY id DESC LIMIT 1;
33SELECT setval('seq_experimenterannotationlink', id) FROM experimenterannotationlink ORDER BY id DESC LIMIT 1;
34SELECT setval('seq_experimentergroup', id) FROM experimentergroup ORDER BY id DESC LIMIT 1;
35SELECT setval('seq_experimentergroupannotationlink', id) FROM experimentergroupannotationlink ORDER BY id DESC LIMIT 1;
36SELECT setval('seq_experimenttype', id) FROM experimenttype ORDER BY id DESC LIMIT 1;
37SELECT setval('seq_externalinfo', id) FROM externalinfo ORDER BY id DESC LIMIT 1;
38SELECT setval('seq_family', id) FROM family ORDER BY id DESC LIMIT 1;
39SELECT setval('seq_filamenttype', id) FROM filamenttype ORDER BY id DESC LIMIT 1;
40SELECT setval('seq_filter', id) FROM filter ORDER BY id DESC LIMIT 1;
41SELECT setval('seq_filterset', id) FROM filterset ORDER BY id DESC LIMIT 1;
42SELECT setval('seq_filtertype', id) FROM filtertype ORDER BY id DESC LIMIT 1;
43SELECT setval('seq_format', id) FROM format ORDER BY id DESC LIMIT 1;
44SELECT setval('seq_groupexperimentermap', id) FROM groupexperimentermap ORDER BY id DESC LIMIT 1;
45SELECT setval('seq_illumination', id) FROM illumination ORDER BY id DESC LIMIT 1;
46SELECT setval('seq_image', id) FROM image ORDER BY id DESC LIMIT 1;
47SELECT setval('seq_imageannotationlink', id) FROM imageannotationlink ORDER BY id DESC LIMIT 1;
48SELECT setval('seq_imagingenvironment', id) FROM imagingenvironment ORDER BY id DESC LIMIT 1;
49SELECT setval('seq_immersion', id) FROM immersion ORDER BY id DESC LIMIT 1;
50SELECT setval('seq_instrument', id) FROM instrument ORDER BY id DESC LIMIT 1;
51SELECT setval('seq_job', id) FROM job ORDER BY id DESC LIMIT 1;
52SELECT setval('seq_joboriginalfilelink', id) FROM joboriginalfilelink ORDER BY id DESC LIMIT 1;
53SELECT setval('seq_jobstatus', id) FROM jobstatus ORDER BY id DESC LIMIT 1;
54SELECT setval('seq_lasermedium', id) FROM lasermedium ORDER BY id DESC LIMIT 1;
55SELECT setval('seq_lasertype', id) FROM lasertype ORDER BY id DESC LIMIT 1;
56SELECT setval('seq_lightsettings', id) FROM lightsettings ORDER BY id DESC LIMIT 1;
57SELECT setval('seq_lightsource', id) FROM lightsource ORDER BY id DESC LIMIT 1;
58SELECT setval('seq_link', id) FROM link ORDER BY id DESC LIMIT 1;
59SELECT setval('seq_logicalchannel', id) FROM logicalchannel ORDER BY id DESC LIMIT 1;
60SELECT setval('seq_medium', id) FROM medium ORDER BY id DESC LIMIT 1;
61SELECT setval('seq_microbeammanipulation', id) FROM microbeammanipulation ORDER BY id DESC LIMIT 1;
62SELECT setval('seq_microbeammanipulationtype', id) FROM microbeammanipulationtype ORDER BY id DESC LIMIT 1;
63SELECT setval('seq_microscope', id) FROM microscope ORDER BY id DESC LIMIT 1;
64SELECT setval('seq_microscopetype', id) FROM microscopetype ORDER BY id DESC LIMIT 1;
65SELECT setval('seq_node', id) FROM node ORDER BY id DESC LIMIT 1;
66SELECT setval('seq_nodeannotationlink', id) FROM nodeannotationlink ORDER BY id DESC LIMIT 1;
67SELECT setval('seq_objective', id) FROM objective ORDER BY id DESC LIMIT 1;
68SELECT setval('seq_objectivesettings', id) FROM objectivesettings ORDER BY id DESC LIMIT 1;
69SELECT setval('seq_originalfile', id) FROM originalfile ORDER BY id DESC LIMIT 1;
70SELECT setval('seq_originalfileannotationlink', id) FROM originalfileannotationlink ORDER BY id DESC LIMIT 1;
71SELECT setval('seq_otf', id) FROM otf ORDER BY id DESC LIMIT 1;
72SELECT setval('seq_photometricinterpretation', id) FROM photometricinterpretation ORDER BY id DESC LIMIT 1;
73SELECT setval('seq_pixels', id) FROM pixels ORDER BY id DESC LIMIT 1;
74SELECT setval('seq_pixelsannotationlink', id) FROM pixelsannotationlink ORDER BY id DESC LIMIT 1;
75SELECT setval('seq_pixelsoriginalfilemap', id) FROM pixelsoriginalfilemap ORDER BY id DESC LIMIT 1;
76SELECT setval('seq_pixelstype', id) FROM pixelstype ORDER BY id DESC LIMIT 1;
77SELECT setval('seq_planeinfo', id) FROM planeinfo ORDER BY id DESC LIMIT 1;
78SELECT setval('seq_planeinfoannotationlink', id) FROM planeinfoannotationlink ORDER BY id DESC LIMIT 1;
79SELECT setval('seq_plate', id) FROM plate ORDER BY id DESC LIMIT 1;
80SELECT setval('seq_plateannotationlink', id) FROM plateannotationlink ORDER BY id DESC LIMIT 1;
81SELECT setval('seq_project', id) FROM project ORDER BY id DESC LIMIT 1;
82SELECT setval('seq_projectannotationlink', id) FROM projectannotationlink ORDER BY id DESC LIMIT 1;
83SELECT setval('seq_projectdatasetlink', id) FROM projectdatasetlink ORDER BY id DESC LIMIT 1;
84SELECT setval('seq_pulse', id) FROM pulse ORDER BY id DESC LIMIT 1;
85SELECT setval('seq_quantumdef', id) FROM quantumdef ORDER BY id DESC LIMIT 1;
86SELECT setval('seq_reagent', id) FROM reagent ORDER BY id DESC LIMIT 1;
87SELECT setval('seq_reagentannotationlink', id) FROM reagentannotationlink ORDER BY id DESC LIMIT 1;
88SELECT setval('seq_renderingdef', id) FROM renderingdef ORDER BY id DESC LIMIT 1;
89SELECT setval('seq_renderingmodel', id) FROM renderingmodel ORDER BY id DESC LIMIT 1;
90SELECT setval('seq_screen', id) FROM screen ORDER BY id DESC LIMIT 1;
91SELECT setval('seq_screenacquisition', id) FROM screenacquisition ORDER BY id DESC LIMIT 1;
92SELECT setval('seq_screenacquisitionannotationlink', id) FROM screenacquisitionannotationlink ORDER BY id DESC LIMIT 1;
93SELECT setval('seq_screenacquisitionwellsamplelink', id) FROM screenacquisitionwellsamplelink ORDER BY id DESC LIMIT 1;
94SELECT setval('seq_screenannotationlink', id) FROM screenannotationlink ORDER BY id DESC LIMIT 1;
95SELECT setval('seq_screenplatelink', id) FROM screenplatelink ORDER BY id DESC LIMIT 1;
96SELECT setval('seq_session', id) FROM session ORDER BY id DESC LIMIT 1;
97SELECT setval('seq_sessionannotationlink', id) FROM sessionannotationlink ORDER BY id DESC LIMIT 1;
98SELECT setval('seq_stagelabel', id) FROM stagelabel ORDER BY id DESC LIMIT 1;
99SELECT setval('seq_statsinfo', id) FROM statsinfo ORDER BY id DESC LIMIT 1;
100SELECT setval('seq_thumbnail', id) FROM thumbnail ORDER BY id DESC LIMIT 1;
101SELECT setval('seq_transmittancerange', id) FROM transmittancerange ORDER BY id DESC LIMIT 1;
102SELECT setval('seq_well', id) FROM well ORDER BY id DESC LIMIT 1;
103SELECT setval('seq_wellannotationlink', id) FROM wellannotationlink ORDER BY id DESC LIMIT 1;
104SELECT setval('seq_wellreagentlink', id) FROM wellreagentlink ORDER BY id DESC LIMIT 1;
105SELECT setval('seq_wellsample', id) FROM wellsample ORDER BY id DESC LIMIT 1;
106SELECT setval('seq_wellsampleannotationlink', id) FROM wellsampleannotationlink ORDER BY id DESC LIMIT 1;
107COMMIT;

1.3.13-PRO © 2008-2011 Agilo Software all rights reserved (this page was served in: 0.55244 sec.)

We're Hiring!