002_InventoryStore.sql 1.9 KB

12345678910111213141516171819202122232425262728293031
  1. BEGIN;
  2. ALTER TABLE inventoryfolders change folderID folderIDold varchar(36);
  3. ALTER TABLE inventoryfolders change agentID agentIDold varchar(36);
  4. ALTER TABLE inventoryfolders change parentFolderID parentFolderIDold varchar(36);
  5. ALTER TABLE inventoryfolders add folderID char(36) not null default '00000000-0000-0000-0000-000000000000';
  6. ALTER TABLE inventoryfolders add agentID char(36) default NULL;
  7. ALTER TABLE inventoryfolders add parentFolderID char(36) default NULL;
  8. UPDATE inventoryfolders set folderID = folderIDold, agentID = agentIDold, parentFolderID = parentFolderIDold;
  9. ALTER TABLE inventoryfolders drop folderIDold;
  10. ALTER TABLE inventoryfolders drop agentIDold;
  11. ALTER TABLE inventoryfolders drop parentFolderIDold;
  12. ALTER TABLE inventoryfolders add constraint primary key(folderID);
  13. ALTER TABLE inventoryfolders add index inventoryfolders_agentid(agentID);
  14. ALTER TABLE inventoryfolders add index inventoryfolders_parentFolderid(parentFolderID);
  15. ALTER TABLE inventoryitems change inventoryID inventoryIDold varchar(36);
  16. ALTER TABLE inventoryitems change avatarID avatarIDold varchar(36);
  17. ALTER TABLE inventoryitems change parentFolderID parentFolderIDold varchar(36);
  18. ALTER TABLE inventoryitems add inventoryID char(36) not null default '00000000-0000-0000-0000-000000000000';
  19. ALTER TABLE inventoryitems add avatarID char(36) default NULL;
  20. ALTER TABLE inventoryitems add parentFolderID char(36) default NULL;
  21. UPDATE inventoryitems set inventoryID = inventoryIDold, avatarID = avatarIDold, parentFolderID = parentFolderIDold;
  22. ALTER TABLE inventoryitems drop inventoryIDold;
  23. ALTER TABLE inventoryitems drop avatarIDold;
  24. ALTER TABLE inventoryitems drop parentFolderIDold;
  25. ALTER TABLE inventoryitems add constraint primary key(inventoryID);
  26. ALTER TABLE inventoryitems add index inventoryitems_avatarid(avatarID);
  27. ALTER TABLE inventoryitems add index inventoryitems_parentFolderid(parentFolderID);
  28. COMMIT;