AssetStore.migrations 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. :VERSION 1
  2. BEGIN TRANSACTION;
  3. CREATE TABLE assets(
  4. UUID varchar(255) primary key,
  5. Name varchar(255),
  6. Description varchar(255),
  7. Type integer,
  8. InvType integer,
  9. Local integer,
  10. Temporary integer,
  11. Data blob);
  12. COMMIT;
  13. :VERSION 2
  14. BEGIN TRANSACTION;
  15. CREATE TEMPORARY TABLE assets_backup(UUID,Name,Description,Type,Local,Temporary,Data);
  16. INSERT INTO assets_backup SELECT UUID,Name,Description,Type,Local,Temporary,Data FROM assets;
  17. DROP TABLE assets;
  18. CREATE TABLE assets(UUID,Name,Description,Type,Local,Temporary,Data);
  19. INSERT INTO assets SELECT UUID,Name,Description,Type,Local,Temporary,Data FROM assets_backup;
  20. DROP TABLE assets_backup;
  21. COMMIT;
  22. :VERSION 3
  23. DELETE FROM assets WHERE UUID = 'dc4b9f0bd00845c696a401dd947ac621'
  24. :VERSION 4
  25. BEGIN;
  26. update assets
  27. set UUID = substr(UUID, 1, 8) || "-" || substr(UUID, 9, 4) || "-" || substr(UUID, 13, 4) || "-" || substr(UUID, 17, 4) || "-" || substr(UUID, 21, 12)
  28. where UUID not like '%-%';
  29. COMMIT;
  30. :VERSION 5
  31. BEGIN TRANSACTION;
  32. CREATE TEMPORARY TABLE assets_backup(UUID,Name,Description,Type,Local,Temporary,Data);
  33. INSERT INTO assets_backup SELECT UUID,Name,Description,Type,Local,Temporary,Data FROM assets;
  34. DROP TABLE assets;
  35. CREATE TABLE assets(
  36. UUID NOT NULL PRIMARY KEY,
  37. Name,
  38. Description,
  39. Type,
  40. Local,
  41. Temporary,
  42. asset_flags INTEGER NOT NULL DEFAULT 0,
  43. CreatorID varchar(128) default '',
  44. Data);
  45. INSERT INTO assets(UUID,Name,Description,Type,Local,Temporary,Data)
  46. SELECT UUID,Name,Description,Type,Local,Temporary,Data FROM assets_backup;
  47. DROP TABLE assets_backup;
  48. COMMIT;