guacamole-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jmuehl...@apache.org
Subject [1/3] incubator-guacamole-client git commit: GUACAMOLE-163: Remove DEFAULT CURRENT_TIMESTAMP from guacamole_user's password_date column (compatibility with MySQL 5.5 and older).
Date Sun, 22 Jan 2017 20:45:01 GMT
Repository: incubator-guacamole-client
Updated Branches:
  refs/heads/master 721995776 -> 005f6153f


GUACAMOLE-163: Remove DEFAULT CURRENT_TIMESTAMP from guacamole_user's password_date column
(compatibility with MySQL 5.5 and older).


Project: http://git-wip-us.apache.org/repos/asf/incubator-guacamole-client/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-guacamole-client/commit/b69599e8
Tree: http://git-wip-us.apache.org/repos/asf/incubator-guacamole-client/tree/b69599e8
Diff: http://git-wip-us.apache.org/repos/asf/incubator-guacamole-client/diff/b69599e8

Branch: refs/heads/master
Commit: b69599e822d3204ba7649cdeb1b71b00cca2b37d
Parents: cdf7e2c
Author: Michael Jumper <mjumper@apache.org>
Authored: Sun Jan 22 11:58:41 2017 -0800
Committer: Michael Jumper <mjumper@apache.org>
Committed: Sun Jan 22 12:04:01 2017 -0800

----------------------------------------------------------------------
 .../guacamole-auth-jdbc-mysql/schema/001-create-schema.sql    | 2 +-
 .../schema/002-create-admin-user.sql                          | 5 +++--
 .../schema/upgrade/upgrade-pre-0.9.11.sql                     | 7 ++++++-
 .../schema/001-create-schema.sql                              | 2 +-
 .../schema/002-create-admin-user.sql                          | 5 +++--
 .../schema/upgrade/upgrade-pre-0.9.11.sql                     | 7 ++++++-
 6 files changed, 20 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-guacamole-client/blob/b69599e8/extensions/guacamole-auth-jdbc/modules/guacamole-auth-jdbc-mysql/schema/001-create-schema.sql
----------------------------------------------------------------------
diff --git a/extensions/guacamole-auth-jdbc/modules/guacamole-auth-jdbc-mysql/schema/001-create-schema.sql
b/extensions/guacamole-auth-jdbc/modules/guacamole-auth-jdbc-mysql/schema/001-create-schema.sql
index ebf5b7d..37a8259 100644
--- a/extensions/guacamole-auth-jdbc/modules/guacamole-auth-jdbc-mysql/schema/001-create-schema.sql
+++ b/extensions/guacamole-auth-jdbc/modules/guacamole-auth-jdbc-mysql/schema/001-create-schema.sql
@@ -85,7 +85,7 @@ CREATE TABLE `guacamole_user` (
   `username`      varchar(128) NOT NULL,
   `password_hash` binary(32)   NOT NULL,
   `password_salt` binary(32),
-  `password_date` datetime     NOT NULL DEFAULT CURRENT_TIMESTAMP,
+  `password_date` datetime     NOT NULL,
 
   -- Account disabled/expired status
   `disabled`      boolean      NOT NULL DEFAULT 0,

http://git-wip-us.apache.org/repos/asf/incubator-guacamole-client/blob/b69599e8/extensions/guacamole-auth-jdbc/modules/guacamole-auth-jdbc-mysql/schema/002-create-admin-user.sql
----------------------------------------------------------------------
diff --git a/extensions/guacamole-auth-jdbc/modules/guacamole-auth-jdbc-mysql/schema/002-create-admin-user.sql
b/extensions/guacamole-auth-jdbc/modules/guacamole-auth-jdbc-mysql/schema/002-create-admin-user.sql
index cc73a01..cfc8313 100644
--- a/extensions/guacamole-auth-jdbc/modules/guacamole-auth-jdbc-mysql/schema/002-create-admin-user.sql
+++ b/extensions/guacamole-auth-jdbc/modules/guacamole-auth-jdbc-mysql/schema/002-create-admin-user.sql
@@ -18,10 +18,11 @@
 --
 
 -- Create default user "guacadmin" with password "guacadmin"
-INSERT INTO guacamole_user (username, password_hash, password_salt)
+INSERT INTO guacamole_user (username, password_hash, password_salt, password_date)
 VALUES ('guacadmin',
     x'CA458A7D494E3BE824F5E1E175A1556C0F8EEF2C2D7DF3633BEC4A29C4411960',  -- 'guacadmin'
-    x'FE24ADC5E11E2B25288D1704ABE67A79E342ECC26064CE69C5B3177795A82264');
+    x'FE24ADC5E11E2B25288D1704ABE67A79E342ECC26064CE69C5B3177795A82264',
+    NOW());
 
 -- Grant this user all system permissions
 INSERT INTO guacamole_system_permission

http://git-wip-us.apache.org/repos/asf/incubator-guacamole-client/blob/b69599e8/extensions/guacamole-auth-jdbc/modules/guacamole-auth-jdbc-mysql/schema/upgrade/upgrade-pre-0.9.11.sql
----------------------------------------------------------------------
diff --git a/extensions/guacamole-auth-jdbc/modules/guacamole-auth-jdbc-mysql/schema/upgrade/upgrade-pre-0.9.11.sql
b/extensions/guacamole-auth-jdbc/modules/guacamole-auth-jdbc-mysql/schema/upgrade/upgrade-pre-0.9.11.sql
index ecfde88..84576eb 100644
--- a/extensions/guacamole-auth-jdbc/modules/guacamole-auth-jdbc-mysql/schema/upgrade/upgrade-pre-0.9.11.sql
+++ b/extensions/guacamole-auth-jdbc/modules/guacamole-auth-jdbc-mysql/schema/upgrade/upgrade-pre-0.9.11.sql
@@ -22,7 +22,12 @@
 --
 
 ALTER TABLE guacamole_user
-    ADD COLUMN password_date DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP;
+    ADD COLUMN password_date DATETIME;
+
+UPDATE guacamole_user SET password_date = NOW();
+
+ALTER TABLE guacamole_user
+    MODIFY COLUMN password_date DATETIME NOT NULL;
 
 --
 -- User password history

http://git-wip-us.apache.org/repos/asf/incubator-guacamole-client/blob/b69599e8/extensions/guacamole-auth-jdbc/modules/guacamole-auth-jdbc-postgresql/schema/001-create-schema.sql
----------------------------------------------------------------------
diff --git a/extensions/guacamole-auth-jdbc/modules/guacamole-auth-jdbc-postgresql/schema/001-create-schema.sql
b/extensions/guacamole-auth-jdbc/modules/guacamole-auth-jdbc-postgresql/schema/001-create-schema.sql
index f2ad2c4..199b4bd 100644
--- a/extensions/guacamole-auth-jdbc/modules/guacamole-auth-jdbc-postgresql/schema/001-create-schema.sql
+++ b/extensions/guacamole-auth-jdbc/modules/guacamole-auth-jdbc-postgresql/schema/001-create-schema.sql
@@ -126,7 +126,7 @@ CREATE TABLE guacamole_user (
   username      varchar(128) NOT NULL,
   password_hash bytea        NOT NULL,
   password_salt bytea,
-  password_date timestamptz  NOT NULL DEFAULT CURRENT_TIMESTAMP,
+  password_date timestamptz  NOT NULL,
 
   -- Account disabled/expired status
   disabled      boolean      NOT NULL DEFAULT FALSE,

http://git-wip-us.apache.org/repos/asf/incubator-guacamole-client/blob/b69599e8/extensions/guacamole-auth-jdbc/modules/guacamole-auth-jdbc-postgresql/schema/002-create-admin-user.sql
----------------------------------------------------------------------
diff --git a/extensions/guacamole-auth-jdbc/modules/guacamole-auth-jdbc-postgresql/schema/002-create-admin-user.sql
b/extensions/guacamole-auth-jdbc/modules/guacamole-auth-jdbc-postgresql/schema/002-create-admin-user.sql
index feeb9ad..6425bf6 100644
--- a/extensions/guacamole-auth-jdbc/modules/guacamole-auth-jdbc-postgresql/schema/002-create-admin-user.sql
+++ b/extensions/guacamole-auth-jdbc/modules/guacamole-auth-jdbc-postgresql/schema/002-create-admin-user.sql
@@ -19,10 +19,11 @@
 
 
 -- Create default user "guacadmin" with password "guacadmin"
-INSERT INTO guacamole_user (username, password_hash, password_salt)
+INSERT INTO guacamole_user (username, password_hash, password_salt, password_date)
 VALUES ('guacadmin',
     E'\\xCA458A7D494E3BE824F5E1E175A1556C0F8EEF2C2D7DF3633BEC4A29C4411960',  -- 'guacadmin'
-    E'\\xFE24ADC5E11E2B25288D1704ABE67A79E342ECC26064CE69C5B3177795A82264');
+    E'\\xFE24ADC5E11E2B25288D1704ABE67A79E342ECC26064CE69C5B3177795A82264',
+    CURRENT_TIMESTAMP);
 
 -- Grant this user all system permissions
 INSERT INTO guacamole_system_permission

http://git-wip-us.apache.org/repos/asf/incubator-guacamole-client/blob/b69599e8/extensions/guacamole-auth-jdbc/modules/guacamole-auth-jdbc-postgresql/schema/upgrade/upgrade-pre-0.9.11.sql
----------------------------------------------------------------------
diff --git a/extensions/guacamole-auth-jdbc/modules/guacamole-auth-jdbc-postgresql/schema/upgrade/upgrade-pre-0.9.11.sql
b/extensions/guacamole-auth-jdbc/modules/guacamole-auth-jdbc-postgresql/schema/upgrade/upgrade-pre-0.9.11.sql
index c047a8f..fad3bb4 100644
--- a/extensions/guacamole-auth-jdbc/modules/guacamole-auth-jdbc-postgresql/schema/upgrade/upgrade-pre-0.9.11.sql
+++ b/extensions/guacamole-auth-jdbc/modules/guacamole-auth-jdbc-postgresql/schema/upgrade/upgrade-pre-0.9.11.sql
@@ -22,7 +22,12 @@
 --
 
 ALTER TABLE guacamole_user
-    ADD COLUMN password_date timestamptz NOT NULL DEFAULT CURRENT_TIMESTAMP;
+    ADD COLUMN password_date timestamptz;
+
+UPDATE guacamole_user SET password_date = CURRENT_TIMESTAMP;
+
+ALTER TABLE guacamole_user
+    ALTER COLUMN password_date SET NOT NULL;
 
 --
 -- User password history


Mime
View raw message