1
0

InventoryStore.migrations 3.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  1. :VERSION 1
  2. BEGIN TRANSACTION;
  3. CREATE TABLE inventoryfolders(
  4. UUID varchar(255) primary key,
  5. name varchar(255),
  6. agentID varchar(255),
  7. parentID varchar(255),
  8. type integer,
  9. version integer);
  10. CREATE TABLE inventoryitems(
  11. UUID varchar(255) primary key,
  12. assetID varchar(255),
  13. assetType integer,
  14. invType integer,
  15. parentFolderID varchar(255),
  16. avatarID varchar(255),
  17. creatorsID varchar(255),
  18. inventoryName varchar(255),
  19. inventoryDescription varchar(255),
  20. inventoryNextPermissions integer,
  21. inventoryCurrentPermissions integer,
  22. inventoryBasePermissions integer,
  23. inventoryEveryOnePermissions integer,
  24. salePrice integer default 99,
  25. saleType integer default 0,
  26. creationDate integer default 2000,
  27. groupID varchar(255) default '00000000-0000-0000-0000-000000000000',
  28. groupOwned integer default 0,
  29. flags integer default 0);
  30. COMMIT;
  31. :VERSION 2
  32. BEGIN TRANSACTION;
  33. create index inventoryfolders_agentid on inventoryfolders(agentid);
  34. create index inventoryfolders_parentid on inventoryfolders(parentid);
  35. create index inventoryitems_parentfolderid on inventoryitems(parentfolderid);
  36. create index inventoryitems_avatarid on inventoryitems(avatarid);
  37. COMMIT;
  38. :VERSION 3
  39. BEGIN;
  40. alter table inventoryitems add column inventoryGroupPermissions integer unsigned not null default 0;
  41. COMMIT;
  42. :VERSION 4
  43. BEGIN;
  44. update inventoryitems
  45. set UUID = substr(UUID, 1, 8) || "-" || substr(UUID, 9, 4) || "-" || substr(UUID, 13, 4) || "-" || substr(UUID, 17, 4) || "-" || substr(UUID, 21, 12)
  46. where UUID not like '%-%';
  47. update inventoryitems
  48. set assetID = substr(assetID, 1, 8) || "-" || substr(assetID, 9, 4) || "-" || substr(assetID, 13, 4) || "-" || substr(assetID, 17, 4) || "-" || substr(assetID, 21, 12)
  49. where assetID not like '%-%';
  50. update inventoryitems
  51. set parentFolderID = substr(parentFolderID, 1, 8) || "-" || substr(parentFolderID, 9, 4) || "-" || substr(parentFolderID, 13, 4) || "-" || substr(parentFolderID, 17, 4) || "-" || substr(parentFolderID, 21, 12)
  52. where parentFolderID not like '%-%';
  53. update inventoryitems
  54. set avatarID = substr(avatarID, 1, 8) || "-" || substr(avatarID, 9, 4) || "-" || substr(avatarID, 13, 4) || "-" || substr(avatarID, 17, 4) || "-" || substr(avatarID, 21, 12)
  55. where avatarID not like '%-%';
  56. update inventoryitems
  57. set creatorsID = substr(creatorsID, 1, 8) || "-" || substr(creatorsID, 9, 4) || "-" || substr(creatorsID, 13, 4) || "-" || substr(creatorsID, 17, 4) || "-" || substr(creatorsID, 21, 12)
  58. where creatorsID not like '%-%';
  59. update inventoryfolders
  60. set UUID = substr(UUID, 1, 8) || "-" || substr(UUID, 9, 4) || "-" || substr(UUID, 13, 4) || "-" || substr(UUID, 17, 4) || "-" || substr(UUID, 21, 12)
  61. where UUID not like '%-%';
  62. update inventoryfolders
  63. set agentID = substr(agentID, 1, 8) || "-" || substr(agentID, 9, 4) || "-" || substr(agentID, 13, 4) || "-" || substr(agentID, 17, 4) || "-" || substr(agentID, 21, 12)
  64. where agentID not like '%-%';
  65. update inventoryfolders
  66. set parentID = substr(parentID, 1, 8) || "-" || substr(parentID, 9, 4) || "-" || substr(parentID, 13, 4) || "-" || substr(parentID, 17, 4) || "-" || substr(parentID, 21, 12)
  67. where parentID not like '%-%';
  68. COMMIT;