aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Data/MSSQL/Resources/InventoryStore.migrations
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--OpenSim/Data/MSSQL/Resources/InventoryStore.migrations174
1 files changed, 174 insertions, 0 deletions
diff --git a/OpenSim/Data/MSSQL/Resources/InventoryStore.migrations b/OpenSim/Data/MSSQL/Resources/InventoryStore.migrations
new file mode 100644
index 0000000..cd5dfdc
--- /dev/null
+++ b/OpenSim/Data/MSSQL/Resources/InventoryStore.migrations
@@ -0,0 +1,174 @@
1:VERSION 1
2
3BEGIN TRANSACTION
4
5CREATE TABLE [inventoryfolders] (
6 [folderID] [varchar](36) NOT NULL default '',
7 [agentID] [varchar](36) default NULL,
8 [parentFolderID] [varchar](36) default NULL,
9 [folderName] [varchar](64) default NULL,
10 [type] [smallint] NOT NULL default 0,
11 [version] [int] NOT NULL default 0,
12 PRIMARY KEY CLUSTERED
13(
14 [folderID] ASC
15)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
16) ON [PRIMARY]
17
18CREATE NONCLUSTERED INDEX [owner] ON [inventoryfolders]
19(
20 [agentID] ASC
21)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
22
23CREATE NONCLUSTERED INDEX [parent] ON [inventoryfolders]
24(
25 [parentFolderID] ASC
26)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
27
28
29CREATE TABLE [inventoryitems] (
30 [inventoryID] [varchar](36) NOT NULL default '',
31 [assetID] [varchar](36) default NULL,
32 [assetType] [int] default NULL,
33 [parentFolderID] [varchar](36) default NULL,
34 [avatarID] [varchar](36) default NULL,
35 [inventoryName] [varchar](64) default NULL,
36 [inventoryDescription] [varchar](128) default NULL,
37 [inventoryNextPermissions] [int] default NULL,
38 [inventoryCurrentPermissions] [int] default NULL,
39 [invType] [int] default NULL,
40 [creatorID] [varchar](36) default NULL,
41 [inventoryBasePermissions] [int] NOT NULL default 0,
42 [inventoryEveryOnePermissions] [int] NOT NULL default 0,
43 [salePrice] [int] default NULL,
44 [saleType] [tinyint] default NULL,
45 [creationDate] [int] default NULL,
46 [groupID] [varchar](36) default NULL,
47 [groupOwned] [bit] default NULL,
48 [flags] [int] default NULL,
49 PRIMARY KEY CLUSTERED
50(
51 [inventoryID] ASC
52)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
53) ON [PRIMARY]
54
55
56CREATE NONCLUSTERED INDEX [owner] ON [inventoryitems]
57(
58 [avatarID] ASC
59)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
60
61CREATE NONCLUSTERED INDEX [folder] ON [inventoryitems]
62(
63 [parentFolderID] ASC
64)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
65
66COMMIT
67
68
69:VERSION 2
70
71BEGIN TRANSACTION
72
73ALTER TABLE inventoryitems ADD inventoryGroupPermissions INTEGER NOT NULL default 0
74
75COMMIT
76
77:VERSION 3
78
79/* To prevent any potential data loss issues, you should review this script in detail before running it outside the context of the database designer.*/
80BEGIN TRANSACTION
81
82CREATE TABLE dbo.Tmp_inventoryfolders
83 (
84 folderID uniqueidentifier NOT NULL DEFAULT ('00000000-0000-0000-0000-000000000000'),
85 agentID uniqueidentifier NULL DEFAULT (NULL),
86 parentFolderID uniqueidentifier NULL DEFAULT (NULL),
87 folderName varchar(64) NULL DEFAULT (NULL),
88 type smallint NOT NULL DEFAULT ((0)),
89 version int NOT NULL DEFAULT ((0))
90 ) ON [PRIMARY]
91
92IF EXISTS(SELECT * FROM dbo.inventoryfolders)
93 EXEC('INSERT INTO dbo.Tmp_inventoryfolders (folderID, agentID, parentFolderID, folderName, type, version)
94 SELECT CONVERT(uniqueidentifier, folderID), CONVERT(uniqueidentifier, agentID), CONVERT(uniqueidentifier, parentFolderID), folderName, type, version FROM dbo.inventoryfolders WITH (HOLDLOCK TABLOCKX)')
95
96DROP TABLE dbo.inventoryfolders
97
98EXECUTE sp_rename N'dbo.Tmp_inventoryfolders', N'inventoryfolders', 'OBJECT'
99
100ALTER TABLE dbo.inventoryfolders ADD CONSTRAINT
101 PK__inventor__C2FABFB3173876EA PRIMARY KEY CLUSTERED
102 (
103 folderID
104 ) WITH( STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
105
106CREATE NONCLUSTERED INDEX owner ON dbo.inventoryfolders
107 (
108 agentID
109 ) WITH( STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
110
111CREATE NONCLUSTERED INDEX parent ON dbo.inventoryfolders
112 (
113 parentFolderID
114 ) WITH( STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
115
116COMMIT
117
118
119:VERSION 4
120
121BEGIN TRANSACTION
122
123CREATE TABLE dbo.Tmp_inventoryitems
124 (
125 inventoryID uniqueidentifier NOT NULL DEFAULT ('00000000-0000-0000-0000-000000000000'),
126 assetID uniqueidentifier NULL DEFAULT (NULL),
127 assetType int NULL DEFAULT (NULL),
128 parentFolderID uniqueidentifier NULL DEFAULT (NULL),
129 avatarID uniqueidentifier NULL DEFAULT (NULL),
130 inventoryName varchar(64) NULL DEFAULT (NULL),
131 inventoryDescription varchar(128) NULL DEFAULT (NULL),
132 inventoryNextPermissions int NULL DEFAULT (NULL),
133 inventoryCurrentPermissions int NULL DEFAULT (NULL),
134 invType int NULL DEFAULT (NULL),
135 creatorID uniqueidentifier NULL DEFAULT (NULL),
136 inventoryBasePermissions int NOT NULL DEFAULT ((0)),
137 inventoryEveryOnePermissions int NOT NULL DEFAULT ((0)),
138 salePrice int NULL DEFAULT (NULL),
139 saleType tinyint NULL DEFAULT (NULL),
140 creationDate int NULL DEFAULT (NULL),
141 groupID uniqueidentifier NULL DEFAULT (NULL),
142 groupOwned bit NULL DEFAULT (NULL),
143 flags int NULL DEFAULT (NULL),
144 inventoryGroupPermissions int NOT NULL DEFAULT ((0))
145 ) ON [PRIMARY]
146
147IF EXISTS(SELECT * FROM dbo.inventoryitems)
148 EXEC('INSERT INTO dbo.Tmp_inventoryitems (inventoryID, assetID, assetType, parentFolderID, avatarID, inventoryName, inventoryDescription, inventoryNextPermissions, inventoryCurrentPermissions, invType, creatorID, inventoryBasePermissions, inventoryEveryOnePermissions, salePrice, saleType, creationDate, groupID, groupOwned, flags, inventoryGroupPermissions)
149 SELECT CONVERT(uniqueidentifier, inventoryID), CONVERT(uniqueidentifier, assetID), assetType, CONVERT(uniqueidentifier, parentFolderID), CONVERT(uniqueidentifier, avatarID), inventoryName, inventoryDescription, inventoryNextPermissions, inventoryCurrentPermissions, invType, CONVERT(uniqueidentifier, creatorID), inventoryBasePermissions, inventoryEveryOnePermissions, salePrice, saleType, creationDate, CONVERT(uniqueidentifier, groupID), groupOwned, flags, inventoryGroupPermissions FROM dbo.inventoryitems WITH (HOLDLOCK TABLOCKX)')
150
151DROP TABLE dbo.inventoryitems
152
153EXECUTE sp_rename N'dbo.Tmp_inventoryitems', N'inventoryitems', 'OBJECT'
154
155ALTER TABLE dbo.inventoryitems ADD CONSTRAINT
156 PK__inventor__C4B7BC2220C1E124 PRIMARY KEY CLUSTERED
157 (
158 inventoryID
159 ) WITH( STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
160
161
162CREATE NONCLUSTERED INDEX owner ON dbo.inventoryitems
163 (
164 avatarID
165 ) WITH( STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
166
167CREATE NONCLUSTERED INDEX folder ON dbo.inventoryitems
168 (
169 parentFolderID
170 ) WITH( STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
171
172COMMIT
173
174