123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220 |
- :VERSION 1
- BEGIN TRANSACTION;
- CREATE TABLE inventoryfolders (
- "folderID" varchar(36) NOT NULL default '' PRIMARY KEY,
- "agentID" varchar(36) default NULL,
- "parentFolderID" varchar(36) default NULL,
- "folderName" varchar(64) default NULL,
- "type" smallint NOT NULL default 0,
- "version" int NOT NULL default 0
- );
- CREATE INDEX owner ON inventoryfolders
- (
- "agentID" ASC
- );
- CREATE INDEX parent ON inventoryfolders
- (
- "parentFolderID" ASC
- );
- CREATE TABLE inventoryitems (
- "inventoryID" varchar(36) NOT NULL default '' Primary Key,
- "assetID" varchar(36) default NULL,
- "assetType" int default NULL,
- "parentFolderID" varchar(36) default NULL,
- "avatarID" varchar(36) default NULL,
- "inventoryName" varchar(64) default NULL,
- "inventoryDescription" varchar(128) default NULL,
- "inventoryNextPermissions" int default NULL,
- "inventoryCurrentPermissions" int default NULL,
- "invType" int default NULL,
- "creatorID" varchar(36) default NULL,
- "inventoryBasePermissions" int NOT NULL default 0,
- "inventoryEveryOnePermissions" int NOT NULL default 0,
- "salePrice" int default NULL,
- "saleType" smallint default NULL,
- "creationDate" int default NULL,
- "groupID" varchar(36) default NULL,
- "groupOwned" boolean default NULL,
- "flags" int default NULL
- );
- CREATE INDEX ii_owner ON inventoryitems
- (
- "avatarID" ASC
- );
- CREATE INDEX ii_folder ON inventoryitems
- (
- "parentFolderID" ASC
- );
- COMMIT;
- :VERSION 2
- BEGIN TRANSACTION;
- ALTER TABLE inventoryitems ADD "inventoryGroupPermissions" INTEGER NOT NULL default 0;
- COMMIT;
- :VERSION 3
- /* To prevent any potential data loss issues, you should review this script in detail before running it outside the cotext of the database designer.*/
- BEGIN TRANSACTION;
- CREATE TABLE Tmp_inventoryfolders
- (
- "folderID" uuid NOT NULL DEFAULT ('00000000-0000-0000-0000-000000000000'),
- "agentID" uuid NULL DEFAULT (NULL),
- "parentFolderID" uuid NULL DEFAULT (NULL),
- "folderName" varchar(64) NULL DEFAULT (NULL),
- "type" smallint NOT NULL DEFAULT ((0)),
- "version" int NOT NULL DEFAULT ((0))
- );
- INSERT INTO Tmp_inventoryfolders ("folderID", "agentID", "parentFolderID", "folderName", type, version)
- SELECT cast("folderID" as uuid), cast("agentID" as uuid), cast("parentFolderID" as uuid), "folderName", "type", "version"
- FROM inventoryfolders;
- DROP TABLE inventoryfolders;
- alter table Tmp_inventoryfolders rename to inventoryfolders;
- ALTER TABLE inventoryfolders ADD CONSTRAINT
- PK__inventor__C2FABFB3173876EA PRIMARY KEY
- (
- "folderID"
- );
- CREATE INDEX owner ON inventoryfolders
- (
- "agentID"
- );
- CREATE INDEX parent ON inventoryfolders
- (
- "parentFolderID"
- );
- COMMIT;
- :VERSION 4
- BEGIN TRANSACTION;
- CREATE TABLE Tmp_inventoryitems
- (
- "inventoryID" uuid NOT NULL DEFAULT ('00000000-0000-0000-0000-000000000000'),
- "assetID" uuid NULL DEFAULT (NULL),
- "assetType" int NULL DEFAULT (NULL),
- "parentFolderID" uuid NULL DEFAULT (NULL),
- "avatarID" uuid NULL DEFAULT (NULL),
- "inventoryName" varchar(64) NULL DEFAULT (NULL),
- "inventoryDescription" varchar(128) NULL DEFAULT (NULL),
- "inventoryNextPermissions" int NULL DEFAULT (NULL),
- "inventoryCurrentPermissions" int NULL DEFAULT (NULL),
- "invType" int NULL DEFAULT (NULL),
- "creatorID" uuid NULL DEFAULT (NULL),
- "inventoryBasePermissions" int NOT NULL DEFAULT ((0)),
- "inventoryEveryOnePermissions" int NOT NULL DEFAULT ((0)),
- "salePrice" int NULL DEFAULT (NULL),
- "SaleType" smallint NULL DEFAULT (NULL),
- "creationDate" int NULL DEFAULT (NULL),
- "groupID" uuid NULL DEFAULT (NULL),
- "groupOwned" boolean NULL DEFAULT (NULL),
- "flags" int NULL DEFAULT (NULL),
- "inventoryGroupPermissions" int NOT NULL DEFAULT ((0))
- );
- INSERT INTO Tmp_inventoryitems ("inventoryID", "assetID", "assetType", "parentFolderID", "avatarID", "inventoryName", "inventoryDescription", "inventoryNextPermissions", "inventoryCurrentPermissions", "invType", "creatorID", "inventoryBasePermissions", "inventoryEveryOnePermissions", "salePrice", "SaleType", "creationDate", "groupID", "groupOwned", "flags", "inventoryGroupPermissions")
- SELECT cast("inventoryID" as uuid), cast("assetID" as uuid), "assetType", cast("parentFolderID" as uuid), cast("avatarID" as uuid), "inventoryName", "inventoryDescription", "inventoryNextPermissions", "inventoryCurrentPermissions", "invType", cast("creatorID" as uuid), "inventoryBasePermissions", "inventoryEveryOnePermissions", "salePrice", "SaleType", "creationDate", cast("groupID" as uuid), "groupOwned", "flags", "inventoryGroupPermissions"
- FROM inventoryitems ;
- DROP TABLE inventoryitems;
- alter table Tmp_inventoryitems rename to inventoryitems;
- ALTER TABLE inventoryitems ADD CONSTRAINT
- PK__inventor__C4B7BC2220C1E124 PRIMARY KEY
- (
- "inventoryID"
- );
- CREATE INDEX ii2_owner ON inventoryitems
- (
- "avatarID"
- );
- CREATE INDEX ii2_folder ON inventoryitems
- (
- "parentFolderID"
- );
- COMMIT;
- :VERSION 5
- BEGIN TRANSACTION;
- -- # Restoring defaults:
- -- # NOTE: "inventoryID" does NOT need one: it's NOT NULL PK and a unique Guid must be provided every time anyway!
-
- alter table inventoryitems
- alter column "inventoryBasePermissions" set default 0;
- alter table inventoryitems
- alter column "inventoryEveryOnePermissions" set default 0;
- alter table inventoryitems
- alter column "inventoryGroupPermissions" set default 0 ;
-
- COMMIT ;
-
- :VERSION 7
- BEGIN TRANSACTION;
- -- # "creatorID" goes back to VARCHAR(36) (???)
- alter table inventoryitems
- alter column "creatorID" type varchar(36);
- COMMIT ;
-
- :VERSION 8
- ALTER TABLE inventoryitems
- alter column "creatorID" set DEFAULT '00000000-0000-0000-0000-000000000000';
-
- :VERSION 9
- BEGIN TRANSACTION;
- --# "creatorID" goes up to VARCHAR(255)
- alter table inventoryitems
- alter column "creatorID" type varchar(255);
-
- Commit;
- :VERSION 10
- BEGIN TRANSACTION;
- Alter table inventoryitems Rename Column "SaleType" to "saleType";
- Commit;
|