1
0

XInventoryStore.migrations 2.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. :VERSION 1
  2. BEGIN TRANSACTION;
  3. CREATE TABLE inventoryfolders(
  4. folderName varchar(64),
  5. type integer,
  6. version integer,
  7. folderID varchar(36) primary key,
  8. agentID varchar(36) not null default '00000000-0000-0000-0000-000000000000',
  9. parentFolderID varchar(36) not null default '00000000-0000-0000-0000-000000000000');
  10. CREATE TABLE inventoryitems(
  11. assetID varchar(36),
  12. assetType integer,
  13. inventoryName varchar(64),
  14. inventoryDescription varchar(128),
  15. inventoryNextPermissions integer,
  16. inventoryCurrentPermissions integer,
  17. invType integer,
  18. creatorID varchar(128),
  19. inventoryBasePermissions integer,
  20. inventoryEveryOnePermissions integer,
  21. salePrice integer default 99,
  22. saleType integer default 0,
  23. creationDate integer default 2000,
  24. groupID varchar(36) default '00000000-0000-0000-0000-000000000000',
  25. groupOwned integer default 0,
  26. flags integer default 0,
  27. inventoryID varchar(36) primary key,
  28. parentFolderID varchar(36) not null default '00000000-0000-0000-0000-000000000000',
  29. avatarID varchar(36) not null default '00000000-0000-0000-0000-000000000000',
  30. inventoryGroupPermissions integer not null default 0);
  31. create index inventoryfolders_agentid on inventoryfolders(agentID);
  32. create index inventoryfolders_parentid on inventoryfolders(parentFolderID);
  33. create index inventoryitems_parentfolderid on inventoryitems(parentFolderID);
  34. create index inventoryitems_avatarid on inventoryitems(avatarID);
  35. COMMIT;
  36. :VERSION 2
  37. BEGIN TRANSACTION;
  38. INSERT INTO inventoryfolders (folderName, type, version, folderID, agentID, parentFolderID) SELECT `name` AS folderName, `type` AS type, `version` AS version, `UUID` AS folderID, `agentID` AS agentID, `parentID` AS parentFolderID from old.inventoryfolders;
  39. INSERT INTO inventoryitems (assetID, assetType, inventoryName, inventoryDescription, inventoryNextPermissions, inventoryCurrentPermissions, invType, creatorID, inventoryBasePermissions, inventoryEveryOnePermissions, salePrice, saleType, creationDate, groupID, groupOwned, flags, inventoryID, parentFolderID, avatarID, inventoryGroupPermissions) SELECT `assetID`, `assetType` AS assetType, `inventoryName` AS inventoryName, `inventoryDescription` AS inventoryDescription, `inventoryNextPermissions` AS inventoryNextPermissions, `inventoryCurrentPermissions` AS inventoryCurrentPermissions, `invType` AS invType, `creatorsID` AS creatorID, `inventoryBasePermissions` AS inventoryBasePermissions, `inventoryEveryOnePermissions` AS inventoryEveryOnePermissions, `salePrice` AS salePrice, `saleType` AS saleType, `creationDate` AS creationDate, `groupID` AS groupID, `groupOwned` AS groupOwned, `flags` AS flags, `UUID` AS inventoryID, `parentFolderID` AS parentFolderID, `avatarID` AS avatarID, `inventoryGroupPermissions` AS inventoryGroupPermissions FROM old.inventoryitems;
  40. COMMIT;