XInventoryStore.migrations 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  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. ATTACH 'inventoryStore.db' AS old;
  38. BEGIN TRANSACTION;
  39. 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;
  40. 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;
  41. COMMIT;