diff options
author | Geir Nøklebye | 2015-07-27 14:25:28 +0200 |
---|---|---|
committer | Oren Hurvitz | 2015-07-31 15:57:22 +0100 |
commit | 1de8c3570d0c8d18c181286334de81bf436dfbb4 (patch) | |
tree | f1223afc3ac3997039d5c3e8aa7e77648d92b5b8 | |
parent | Fixed bad log message (diff) | |
download | opensim-SC_OLD-1de8c3570d0c8d18c181286334de81bf436dfbb4.zip opensim-SC_OLD-1de8c3570d0c8d18c181286334de81bf436dfbb4.tar.gz opensim-SC_OLD-1de8c3570d0c8d18c181286334de81bf436dfbb4.tar.bz2 opensim-SC_OLD-1de8c3570d0c8d18c181286334de81bf436dfbb4.tar.xz |
PGSQL migrations for IM_Store, UserProfiles, removal of casting exception for UserProfiles and adding double precision to PGSQL Manager
PGSQL migrations for IM_Store, UserProfiles, removal of casting
exception for UserProfiles and adding double precision to PGSQL Manager.
Fixes the Offline IM to Email toggle and prepares for fixing Offline
IM.
Signed-off-by: Oren Hurvitz <orenh@kitely.com>
Diffstat (limited to '')
-rw-r--r-- | .gitignore | 2 | ||||
-rw-r--r-- | OpenSim/Data/PGSQL/PGSQLManager.cs | 4 | ||||
-rw-r--r-- | OpenSim/Data/PGSQL/PGSQLUserProfilesData.cs | 2 | ||||
-rw-r--r-- | OpenSim/Data/PGSQL/Resources/IM_Store.migrations | 19 | ||||
-rw-r--r-- | OpenSim/Data/PGSQL/Resources/UserProfiles.migrations | 9 |
5 files changed, 35 insertions, 1 deletions
@@ -108,3 +108,5 @@ OpenSim/Tests/test-results/ | |||
108 | test-results/ | 108 | test-results/ |
109 | doc/html | 109 | doc/html |
110 | doc/doxygen.error.log | 110 | doc/doxygen.error.log |
111 | |||
112 | *.patch | ||
diff --git a/OpenSim/Data/PGSQL/PGSQLManager.cs b/OpenSim/Data/PGSQL/PGSQLManager.cs index 97f40b2..46f835a 100644 --- a/OpenSim/Data/PGSQL/PGSQLManager.cs +++ b/OpenSim/Data/PGSQL/PGSQLManager.cs | |||
@@ -249,6 +249,10 @@ namespace OpenSim.Data.PGSQL | |||
249 | { | 249 | { |
250 | return (DateTime)value; | 250 | return (DateTime)value; |
251 | } | 251 | } |
252 | if (PGFieldType == "double precision") | ||
253 | { | ||
254 | return (Double)value; | ||
255 | } | ||
252 | return CreateParameterValue(value); | 256 | return CreateParameterValue(value); |
253 | } | 257 | } |
254 | 258 | ||
diff --git a/OpenSim/Data/PGSQL/PGSQLUserProfilesData.cs b/OpenSim/Data/PGSQL/PGSQLUserProfilesData.cs index 70c67dd..f166976 100644 --- a/OpenSim/Data/PGSQL/PGSQLUserProfilesData.cs +++ b/OpenSim/Data/PGSQL/PGSQLUserProfilesData.cs | |||
@@ -877,7 +877,7 @@ namespace OpenSim.Data.PGSQL | |||
877 | { | 877 | { |
878 | string query = string.Empty; | 878 | string query = string.Empty; |
879 | 879 | ||
880 | query += "SELECT imviaemail,visible,email FROM "; | 880 | query += "SELECT imviaemail::VARCHAR,visible::VARCHAR,email FROM "; |
881 | query += "usersettings WHERE "; | 881 | query += "usersettings WHERE "; |
882 | query += "useruuid = :Id"; | 882 | query += "useruuid = :Id"; |
883 | 883 | ||
diff --git a/OpenSim/Data/PGSQL/Resources/IM_Store.migrations b/OpenSim/Data/PGSQL/Resources/IM_Store.migrations index 70dc011..eb97824 100644 --- a/OpenSim/Data/PGSQL/Resources/IM_Store.migrations +++ b/OpenSim/Data/PGSQL/Resources/IM_Store.migrations | |||
@@ -24,3 +24,22 @@ DELETE FROM `migrations` WHERE name='diva_im_Store'; | |||
24 | */ | 24 | */ |
25 | 25 | ||
26 | COMMIT; | 26 | COMMIT; |
27 | |||
28 | :VERSION 3 # -------------------------- | ||
29 | |||
30 | BEGIN; | ||
31 | |||
32 | -- dropping the table here as there most likely is only one record in the table at the time of migration | ||
33 | |||
34 | DROP TABLE IF EXISTS "public"."im_offline"; | ||
35 | CREATE TABLE "public"."im_offline" ( | ||
36 | "ID" serial, | ||
37 | "PrincipalID" uuid NOT NULL, | ||
38 | "Message" text NOT NULL COLLATE "default", | ||
39 | "TMStamp" timestamp(6) NOT NULL DEFAULT clock_timestamp(), | ||
40 | "FromID" uuid NOT NULL | ||
41 | ) | ||
42 | WITH (OIDS=FALSE); | ||
43 | ALTER TABLE "public"."im_offline" ADD PRIMARY KEY ("ID","PrincipalID","FromID") NOT DEFERRABLE INITIALLY IMMEDIATE; | ||
44 | |||
45 | COMMIT; \ No newline at end of file | ||
diff --git a/OpenSim/Data/PGSQL/Resources/UserProfiles.migrations b/OpenSim/Data/PGSQL/Resources/UserProfiles.migrations index 1544b48..a6bd8ca 100644 --- a/OpenSim/Data/PGSQL/Resources/UserProfiles.migrations +++ b/OpenSim/Data/PGSQL/Resources/UserProfiles.migrations | |||
@@ -143,4 +143,13 @@ ALTER TABLE usersettings ALTER COLUMN visible SET DATA TYPE boolean USING CASE W | |||
143 | ALTER TABLE usersettings ADD COLUMN email varchar(254) NOT NULL; | 143 | ALTER TABLE usersettings ADD COLUMN email varchar(254) NOT NULL; |
144 | ALTER TABLE usersettings ADD PRIMARY KEY (useruuid); | 144 | ALTER TABLE usersettings ADD PRIMARY KEY (useruuid); |
145 | 145 | ||
146 | COMMIT; | ||
147 | |||
148 | |||
149 | :VERSION 5 # ------------------------------- | ||
150 | |||
151 | BEGIN; | ||
152 | |||
153 | ALTER TABLE usersettings ALTER COLUMN imviaemail SET DATA TYPE boolean USING CASE WHEN false THEN false ELSE true END; | ||
154 | |||
146 | COMMIT; \ No newline at end of file | 155 | COMMIT; \ No newline at end of file |