Changeset 69448 in vbox for trunk/src/VBox/ValidationKit/testmanager/db/tmdb-r19-testboxes-3.pgsql
- Timestamp:
- Oct 27, 2017 4:57:29 PM (7 years ago)
- svn:sync-xref-src-repo-rev:
- 118783
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/ValidationKit/testmanager/db/tmdb-r19-testboxes-3.pgsql
r69111 r69448 43 43 LOCK TABLE TestBoxes IN ACCESS EXCLUSIVE MODE; 44 44 LOCK TABLE SchedGroupMembers IN ACCESS EXCLUSIVE MODE; 45 45 46 46 \d+ TestBoxes; 47 47 48 48 -- 49 -- Rename the table, drop foreign keys refering to it, and drop constrains 49 -- Rename the table, drop foreign keys refering to it, and drop constrains 50 50 -- within the table itself. The latter is mostly for naming and we do it 51 51 -- up front in case the database we're running against has different names 52 -- due to previous conversions. 52 -- due to previous conversions. 53 53 -- 54 54 ALTER TABLE TestBoxes RENAME TO OldTestBoxes; … … 65 65 ALTER TABLE OldTestBoxes DROP CONSTRAINT testboxes_pkey; 66 66 ALTER TABLE OldTestBoxes DROP CONSTRAINT testboxes_idgentestbox_key; 67 67 68 68 DROP INDEX IF EXISTS TestBoxesUuidIdx; 69 69 DROP INDEX IF EXISTS TestBoxesExpireEffectiveIdx; 70 70 71 71 -- This output should be free of index, constraints and references from other tables. 72 72 \d+ OldTestBoxes; 73 74 -- 75 -- Create the two new tables before starting data migration (don't want to spend time 73 74 -- 75 -- Create the two new tables before starting data migration (don't want to spend time 76 76 -- on converting strings just to find a typo in the TestBoxes create table syntax). 77 -- 77 -- 78 78 CREATE SEQUENCE TestBoxStrTabIdSeq 79 79 START 1 … … 251 251 -- 252 252 253 INSERT INTO TestBoxes ( 253 INSERT INTO TestBoxes ( 254 254 idTestBox, -- 0 255 255 tsEffective, -- 1 … … 278 278 fCpu64BitGuest, -- 24 279 279 fChipsetIoMmu, -- 25 280 fRawMode, -- 26 281 cMbMemory, -- 27 282 cMbScratch, -- 28 283 idStrReport, -- 29 284 iTestBoxScriptRev, -- 30 280 fRawMode, -- 26 281 cMbMemory, -- 27 282 cMbScratch, -- 28 283 idStrReport, -- 29 284 iTestBoxScriptRev, -- 30 285 285 iPythonHexVersion, -- 31 286 286 enmPendingCmd -- 32 287 287 ) 288 SELECT idTestBox, 289 tsEffective, 290 tsExpire, 291 uidAuthor, 292 idGenTestBox, 293 ip, 294 uuidSystem, 295 sName, 296 st1.idStr, 297 idSchedGroup, 298 fEnabled, 299 enmLomKind, 300 ipLom, 301 pctScaleTimeout, 288 SELECT idTestBox, 289 tsEffective, 290 tsExpire, 291 uidAuthor, 292 idGenTestBox, 293 ip, 294 uuidSystem, 295 sName, 296 st1.idStr, 297 idSchedGroup, 298 fEnabled, 299 enmLomKind, 300 ipLom, 301 pctScaleTimeout, 302 302 NULL, 303 st2.idStr, 304 st3.idStr, 305 st4.idStr, 306 st5.idStr, 303 st2.idStr, 304 st3.idStr, 305 st4.idStr, 306 st5.idStr, 307 307 st6.idStr, 308 lCpuRevision, 309 cCpus, 310 fCpuHwVirt, 311 fCpuNestedPaging, 312 fCpu64BitGuest, 313 fChipsetIoMmu, 308 lCpuRevision, 309 cCpus, 310 fCpuHwVirt, 311 fCpuNestedPaging, 312 fCpu64BitGuest, 313 fChipsetIoMmu, 314 314 NULL, 315 cMbMemory, 316 cMbScratch, 315 cMbMemory, 316 cMbScratch, 317 317 st7.idStr, 318 iTestBoxScriptRev, 319 iPythonHexVersion, 318 iTestBoxScriptRev, 319 iPythonHexVersion, 320 320 enmPendingCmd 321 321 FROM OldTestBoxes … … 333 333 334 334 -- Restore foreign key references to the table. 335 ALTER TABLE TestBoxStatuses ADD CONSTRAINT TestBoxStatuses_idGenTestBox_fkey 335 ALTER TABLE TestBoxStatuses ADD CONSTRAINT TestBoxStatuses_idGenTestBox_fkey 336 336 FOREIGN KEY (idGenTestBox) REFERENCES TestBoxes(idGenTestBox); 337 ALTER TABLE TestSets ADD CONSTRAINT TestSets_idGenTestBox_fkey 337 ALTER TABLE TestSets ADD CONSTRAINT TestSets_idGenTestBox_fkey 338 338 FOREIGN KEY (idGenTestBox) REFERENCES TestBoxes(idGenTestBox); 339 339 … … 345 345 \d TestBoxes; 346 346 347
Note:
See TracChangeset
for help on using the changeset viewer.