diff --git a/.gitignore b/.gitignore index ae452ecce9..1ddfd3a4db 100644 --- a/.gitignore +++ b/.gitignore @@ -108,3 +108,5 @@ OpenSim/Tests/test-results/ test-results/ doc/html doc/doxygen.error.log + +*.patch diff --git a/OpenSim/Data/PGSQL/PGSQLManager.cs b/OpenSim/Data/PGSQL/PGSQLManager.cs index 97f40b260b..46f835ab7e 100644 --- a/OpenSim/Data/PGSQL/PGSQLManager.cs +++ b/OpenSim/Data/PGSQL/PGSQLManager.cs @@ -249,6 +249,10 @@ namespace OpenSim.Data.PGSQL { return (DateTime)value; } + if (PGFieldType == "double precision") + { + return (Double)value; + } return CreateParameterValue(value); } diff --git a/OpenSim/Data/PGSQL/PGSQLUserProfilesData.cs b/OpenSim/Data/PGSQL/PGSQLUserProfilesData.cs index 70c67dd47a..f1669766af 100644 --- a/OpenSim/Data/PGSQL/PGSQLUserProfilesData.cs +++ b/OpenSim/Data/PGSQL/PGSQLUserProfilesData.cs @@ -877,7 +877,7 @@ namespace OpenSim.Data.PGSQL { string query = string.Empty; - query += "SELECT imviaemail,visible,email FROM "; + query += "SELECT imviaemail::VARCHAR,visible::VARCHAR,email FROM "; query += "usersettings WHERE "; query += "useruuid = :Id"; diff --git a/OpenSim/Data/PGSQL/Resources/IM_Store.migrations b/OpenSim/Data/PGSQL/Resources/IM_Store.migrations index 70dc0119d5..eb97824ea3 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'; */ COMMIT; + +:VERSION 3 # -------------------------- + +BEGIN; + +-- dropping the table here as there most likely is only one record in the table at the time of migration + +DROP TABLE IF EXISTS "public"."im_offline"; +CREATE TABLE "public"."im_offline" ( + "ID" serial, + "PrincipalID" uuid NOT NULL, + "Message" text NOT NULL COLLATE "default", + "TMStamp" timestamp(6) NOT NULL DEFAULT clock_timestamp(), + "FromID" uuid NOT NULL +) +WITH (OIDS=FALSE); +ALTER TABLE "public"."im_offline" ADD PRIMARY KEY ("ID","PrincipalID","FromID") NOT DEFERRABLE INITIALLY IMMEDIATE; + +COMMIT; \ No newline at end of file diff --git a/OpenSim/Data/PGSQL/Resources/UserProfiles.migrations b/OpenSim/Data/PGSQL/Resources/UserProfiles.migrations index 1544b488b5..a6bd8caca8 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 ALTER TABLE usersettings ADD COLUMN email varchar(254) NOT NULL; ALTER TABLE usersettings ADD PRIMARY KEY (useruuid); +COMMIT; + + +:VERSION 5 # ------------------------------- + +BEGIN; + +ALTER TABLE usersettings ALTER COLUMN imviaemail SET DATA TYPE boolean USING CASE WHEN false THEN false ELSE true END; + COMMIT; \ No newline at end of file