1
0

004_RegionStore.sql 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. BEGIN TRANSACTION
  2. CREATE TABLE Tmp_primitems
  3. (
  4. itemID varchar(36) NOT NULL,
  5. primID varchar(36) NULL,
  6. assetID varchar(36) NULL,
  7. parentFolderID varchar(36) NULL,
  8. invType int NULL,
  9. assetType int NULL,
  10. name varchar(255) NULL,
  11. description varchar(255) NULL,
  12. creationDate varchar(255) NULL,
  13. creatorID varchar(36) NULL,
  14. ownerID varchar(36) NULL,
  15. lastOwnerID varchar(36) NULL,
  16. groupID varchar(36) NULL,
  17. nextPermissions int NULL,
  18. currentPermissions int NULL,
  19. basePermissions int NULL,
  20. everyonePermissions int NULL,
  21. groupPermissions int NULL
  22. ) ON [PRIMARY]
  23. IF EXISTS(SELECT * FROM primitems)
  24. EXEC('INSERT INTO Tmp_primitems (itemID, primID, assetID, parentFolderID, invType, assetType, name, description, creationDate, creatorID, ownerID, lastOwnerID, groupID, nextPermissions, currentPermissions, basePermissions, everyonePermissions, groupPermissions)
  25. SELECT CONVERT(varchar(36), itemID), CONVERT(varchar(36), primID), CONVERT(varchar(36), assetID), CONVERT(varchar(36), parentFolderID), invType, assetType, name, description, creationDate, CONVERT(varchar(36), creatorID), CONVERT(varchar(36), ownerID), CONVERT(varchar(36), lastOwnerID), CONVERT(varchar(36), groupID), nextPermissions, currentPermissions, basePermissions, everyonePermissions, groupPermissions')
  26. DROP TABLE primitems
  27. EXECUTE sp_rename N'Tmp_primitems', N'primitems', 'OBJECT'
  28. ALTER TABLE primitems ADD CONSTRAINT
  29. PK__primitems__0A688BB1 PRIMARY KEY CLUSTERED
  30. (
  31. itemID
  32. ) WITH( STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
  33. COMMIT