Changeset 31038 for trunk/dbconfig
- Timestamp:
- Mar 24, 2011, 2:09:53 PM (15 years ago)
- Location:
- trunk/dbconfig
- Files:
-
- 3 edited
-
changes.txt (modified) (1 diff)
-
new.md (modified) (1 diff)
-
summitcopy.md (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/dbconfig/changes.txt
r30945 r31038 2007 2007 2008 2008 ALTER TABLE stackSumSkyfile ADD column dtime_convolve FLOAT AFTER dtime_match_stdev; 2009 2010 -- Version 1.1.69 2011 2012 ALTER TABLE summitImfile DROP FOREIGN KEY summitImfile_ibfk_1; 2013 ALTER TABLE pzDownloadExp DROP FOREIGN KEY pzDownloadExp_ibfk_1; 2014 2015 ALTER TABLE summitExp DROP PRIMARY KEY; 2016 ALTER TABLE summitExp ADD COLUMN summit_id BIGINT NOT NULL AUTO_INCREMENT FIRST, ADD PRIMARY KEY (summit_id); 2017 ALTER TABLE summitExp ADD KEY (exp_name,camera,telescope); 2018 2019 2020 ALTER TABLE pzDownloadImfile DROP FOREIGN KEY pzDownloadImfile_ibfk_2; 2021 2022 ALTER TABLE summitImfile ADD COLUMN summit_id BIGINT FIRST; 2023 UPDATE summitImfile,summitExp SET summitImfile.summit_id = summitExp.summit_id WHERE summitImfile.exp_name = summitExp.exp_name AND summitImfile.camera = summitExp.camera AND summitImfile.telescope = summitExp.telescope; 2024 2025 ALTER TABLE summitImfile DROP PRIMARY KEY, ADD PRIMARY KEY (summit_id,class,class_id); 2026 ALTER TABLE summitImfile ADD KEY (exp_name,camera,telescope,class,class_id); 2027 ALTER TABLE summitImfile ADD FOREIGN KEY(summit_id) REFERENCES summitExp(summit_id); 2028 ALTER TABLE summitImfile ADD FOREIGN KEY(exp_name,camera,telescope) REFERENCES summitExp(exp_name,camera,telescope); 2029 2030 2031 ALTER TABLE pzDownloadImfile DROP FOREIGN KEY pzDownloadImfile_ibfk_1; 2032 2033 ALTER TABLE pzDownloadExp ADD COLUMN summit_id BIGINT FIRST; 2034 UPDATE pzDownloadExp,summitExp SET pzDownloadExp.summit_id = summitExp.summit_id WHERE pzDownloadExp.exp_name = summitExp.exp_name AND pzDownloadExp.camera = summitExp.camera AND pzDownloadExp.telescope = summitExp.telescope; 2035 2036 ALTER TABLE pzDownloadExp DROP PRIMARY KEY, ADD PRIMARY KEY (summit_id); 2037 ALTER TABLE pzDownloadExp ADD KEY (exp_name,camera,telescope); 2038 ALTER TABLE pzDownloadExp ADD FOREIGN KEY(summit_id) REFERENCES summitExp(summit_id); 2039 ALTER TABLE pzDownloadExp ADD FOREIGN KEY(exp_name,camera,telescope) REFERENCES summitExp(exp_name,camera,telescope); 2040 2041 2042 ALTER TABLE pzDownloadImfile ADD COLUMN summit_id BIGINT FIRST; 2043 UPDATE pzDownloadImfile,pzDownloadExp SET pzDownloadImfile.summit_id = pzDownloadExp.summit_id WHERE pzDownloadImfile.exp_name = pzDownloadExp.exp_name AND pzDownloadImfile.camera = pzDownloadExp.camera AND pzDownloadImfile.telescope = pzDownloadExp.telescope; 2044 2045 ALTER TABLE pzDownloadImfile DROP PRIMARY KEY, ADD PRIMARY KEY (summit_id,class,class_id); 2046 ALTER TABLE pzDownloadImfile ADD FOREIGN KEY(summit_id) REFERENCES pzDownloadExp(summit_id); 2047 ALTER TABLE pzDownloadImfile ADD FOREIGN KEY(summit_id,class,class_id) REFERENCES summitImfile(summit_id,class,class_id); 2048 ALTER TABLE pzDownloadImfile ADD FOREIGN KEY(exp_name,camera,telescope) REFERENCES summitExp(exp_name,camera,telescope); 2049 ALTER TABLE pzDownloadImfile ADD FOREIGN KEY(exp_name,camera,telescope,class,class_id) REFERENCES summitImfile(exp_name,camera,telescope,class,class_id); 2050 2051 2052 ALTER TABLE newExp ADD COLUMN summit_id BIGINT AFTER exp_id; 2053 UPDATE newExp,pzDownloadExp SET newExp.summit_id = pzDownloadExp.summit_id WHERE newExp.tmp_exp_name = pzDownloadExp.exp_name AND newExp.tmp_camera = pzDownloadExp.camera AND newExp.tmp_telescope = pzDownloadExp.telescope; 2054 2055 ALTER TABLE newExp ADD KEY (summit_id); 2056 2057 2058 UPDATE dbversion set schema_version = '1.1.69', updated= CURRENT_TIMESTAMP(); 2059 2060 2061 -
trunk/dbconfig/new.md
r25418 r31038 1 1 newExp METADATA 2 2 exp_id S64 0 # Primary Key AUTO_INCREMENT 3 summit_id S64 0 # Key 3 4 tmp_exp_name STR 64 # Key 4 5 tmp_camera STR 64 # Key -
trunk/dbconfig/summitcopy.md
r26378 r31038 11 11 # -1 as NULL or 0 might be a valid value (empty fileset) 12 12 summitExp METADATA 13 exp_name STR 64 # Primary Key 14 camera STR 64 # Primary Key 15 telescope STR 64 # Primary Key 13 summit_id S64 0 # Primary Key AUTO_INCREMENT 14 exp_name STR 64 # Key 15 camera STR 64 # Key 16 telescope STR 64 # Key 16 17 dateobs UTC NULL 17 18 exp_type STR 64 … … 26 27 # list of source images -- updated as exposures/filesets are queried 27 28 summitImfile METADATA 28 exp_name STR 64 # Primary Key fkey(exp_name, camera, telescope) ref summitExp(exp_name, camera, telescope) 29 camera STR 64 # Primary Key 30 telescope STR 64 # Primary Key 29 summit_id S64 0 # Primary Key fkey(summit_id) ref summitExp(summit_id) 30 exp_name STR 64 # Key fkey(exp_name, camera, telescope) ref summitExp(exp_name, camera, telescope) 31 camera STR 64 # Key 32 telescope STR 64 # Key 31 33 file_id STR 64 # Key 32 34 bytes S32 0 … … 41 43 # downloaded) 42 44 pzDownloadExp METADATA 43 exp_name STR 64 # Primary Key fkey(exp_name, camera, telescope) ref summitExp(exp_name, camera, telescope) 44 camera STR 64 # Primary Key 45 telescope STR 64 # Primary Key 45 summit_id S64 0 # Primary Key fkey(summit_id) ref summitExp(summit_id) 46 exp_name STR 64 # Key fkey(exp_name, camera, telescope) ref summitExp(exp_name, camera, telescope) 47 camera STR 64 # Key 48 telescope STR 64 # Key 46 49 state STR 64 # Key 47 50 epoch UTC 0001-01-01T00:00:00Z … … 49 52 50 53 pzDownloadImfile METADATA 51 exp_name STR 64 # Primary Key fkey(exp_name, camera, telescope) ref pzDownloadExp(exp_name, camera, telescope) 52 camera STR 64 # Primary Key fkey(exp_name, camera, telescope, class, class_id) ref summitImfile(exp_name, camera, telescope, class, class_id) 53 telescope STR 64 # Primary Key 54 class STR 64 # Primary Key 54 summit_id S64 0 # Primary Key fkey(summit_id) ref pzDownloadExp(summit_id) 55 exp_name STR 64 # Key fkey(exp_name, camera, telescope) ref pzDownloadExp(exp_name, camera, telescope) 56 camera STR 64 # Key fkey(exp_name, camera, telescope, class, class_id) ref summitImfile(exp_name, camera, telescope, class, class_id) 57 telescope STR 64 # Key fkey(exp_name, camera, telescope) ref summitExp(exp_name, camera, telescope) 58 class STR 64 # Primary Key fkey(summit_id,class,class_id) ref summitImfile(summit_id,class,class_id) 55 59 class_id STR 64 # Primary Key 56 60 uri STR 255
Note:
See TracChangeset
for help on using the changeset viewer.
