diff options
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Data/PGSQL/Resources/UserAccount.migrations | 51 |
1 files changed, 51 insertions, 0 deletions
diff --git a/OpenSim/Data/PGSQL/Resources/UserAccount.migrations b/OpenSim/Data/PGSQL/Resources/UserAccount.migrations new file mode 100644 index 0000000..c785463 --- /dev/null +++ b/OpenSim/Data/PGSQL/Resources/UserAccount.migrations | |||
@@ -0,0 +1,51 @@ | |||
1 | :VERSION 1 | ||
2 | |||
3 | CREATE TABLE UserAccounts ( | ||
4 | "PrincipalID" uuid NOT NULL Primary key, | ||
5 | "ScopeID" uuid NOT NULL, | ||
6 | "FirstName" varchar(64) NOT NULL, | ||
7 | "LastName" varchar(64) NOT NULL, | ||
8 | "Email" varchar(64) NULL, | ||
9 | "ServiceURLs" text NULL, | ||
10 | "Created" int default NULL | ||
11 | ); | ||
12 | |||
13 | |||
14 | :VERSION 2 | ||
15 | |||
16 | BEGIN TRANSACTION; | ||
17 | |||
18 | INSERT INTO UserAccounts ("PrincipalID", "ScopeID", "FirstName", "LastName", "Email", "ServiceURLs", "Created") | ||
19 | SELECT UUID AS "PrincipalID", '00000000-0000-0000-0000-000000000000' AS "ScopeID", | ||
20 | username AS "FirstName", | ||
21 | lastname AS "LastName", | ||
22 | email as "Email", ( | ||
23 | 'AssetServerURI=' + | ||
24 | userAssetURI + ' InventoryServerURI=' + userInventoryURI + ' GatewayURI= HomeURI=') AS "ServiceURLs", | ||
25 | created as "Created" FROM users; | ||
26 | |||
27 | COMMIT; | ||
28 | |||
29 | :VERSION 3 | ||
30 | |||
31 | BEGIN TRANSACTION; | ||
32 | |||
33 | CREATE UNIQUE INDEX "PrincipalID" ON UserAccounts("PrincipalID"); | ||
34 | CREATE INDEX "Email" ON UserAccounts("Email"); | ||
35 | CREATE INDEX "FirstName" ON UserAccounts("FirstName"); | ||
36 | CREATE INDEX "LastName" ON UserAccounts("LastName"); | ||
37 | CREATE INDEX Name ON UserAccounts("FirstName","LastName"); | ||
38 | |||
39 | COMMIT; | ||
40 | |||
41 | :VERSION 4 | ||
42 | |||
43 | BEGIN TRANSACTION; | ||
44 | |||
45 | ALTER TABLE UserAccounts ADD "UserLevel" integer NOT NULL DEFAULT 0; | ||
46 | ALTER TABLE UserAccounts ADD "UserFlags" integer NOT NULL DEFAULT 0; | ||
47 | ALTER TABLE UserAccounts ADD "UserTitle" varchar(64) NOT NULL DEFAULT ''; | ||
48 | |||
49 | COMMIT; | ||
50 | |||
51 | |||