diff options
author | AlexRa | 2010-05-06 23:16:36 +0300 |
---|---|---|
committer | AlexRa | 2010-05-18 22:16:13 +0300 |
commit | 020f38774fbe8e0f53b0cb28ab49b378b9dcd325 (patch) | |
tree | 5d936d6450d580cf24e133047df7ff8d759de557 /OpenSim/Data/MSSQL/Resources/InventoryStore.migrations | |
parent | Migrations for SQLite converted to new format (diff) | |
download | opensim-SC-020f38774fbe8e0f53b0cb28ab49b378b9dcd325.zip opensim-SC-020f38774fbe8e0f53b0cb28ab49b378b9dcd325.tar.gz opensim-SC-020f38774fbe8e0f53b0cb28ab49b378b9dcd325.tar.bz2 opensim-SC-020f38774fbe8e0f53b0cb28ab49b378b9dcd325.tar.xz |
MS SQL migrations converted to the new format
Diffstat (limited to 'OpenSim/Data/MSSQL/Resources/InventoryStore.migrations')
-rw-r--r-- | OpenSim/Data/MSSQL/Resources/InventoryStore.migrations | 174 |
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 | |||
3 | BEGIN TRANSACTION | ||
4 | |||
5 | CREATE 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 | |||
18 | CREATE 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 | |||
23 | CREATE 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 | |||
29 | CREATE 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 | |||
56 | CREATE 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 | |||
61 | CREATE 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 | |||
66 | COMMIT | ||
67 | |||
68 | |||
69 | :VERSION 2 | ||
70 | |||
71 | BEGIN TRANSACTION | ||
72 | |||
73 | ALTER TABLE inventoryitems ADD inventoryGroupPermissions INTEGER NOT NULL default 0 | ||
74 | |||
75 | COMMIT | ||
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.*/ | ||
80 | BEGIN TRANSACTION | ||
81 | |||
82 | CREATE 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 | |||
92 | IF 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 | |||
96 | DROP TABLE dbo.inventoryfolders | ||
97 | |||
98 | EXECUTE sp_rename N'dbo.Tmp_inventoryfolders', N'inventoryfolders', 'OBJECT' | ||
99 | |||
100 | ALTER 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 | |||
106 | CREATE 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 | |||
111 | CREATE 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 | |||
116 | COMMIT | ||
117 | |||
118 | |||
119 | :VERSION 4 | ||
120 | |||
121 | BEGIN TRANSACTION | ||
122 | |||
123 | CREATE 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 | |||
147 | IF 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 | |||
151 | DROP TABLE dbo.inventoryitems | ||
152 | |||
153 | EXECUTE sp_rename N'dbo.Tmp_inventoryitems', N'inventoryitems', 'OBJECT' | ||
154 | |||
155 | ALTER 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 | |||
162 | CREATE 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 | |||
167 | CREATE 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 | |||
172 | COMMIT | ||
173 | |||
174 | |||