summaryrefslogtreecommitdiffstats
path: root/database/postgresql/sql-schema.sql
diff options
context:
space:
mode:
Diffstat (limited to 'database/postgresql/sql-schema.sql')
-rw-r--r--database/postgresql/sql-schema.sql10
1 files changed, 10 insertions, 0 deletions
diff --git a/database/postgresql/sql-schema.sql b/database/postgresql/sql-schema.sql
index 6634344..67e8841 100644
--- a/database/postgresql/sql-schema.sql
+++ b/database/postgresql/sql-schema.sql
@@ -204,6 +204,16 @@ CREATE TABLE eurephia_adminlog (
CREATE INDEX eurephia_adminlog_uid ON eurephia_adminlog(uid);
CREATE INDEX eurephia_adminlog_sesskey ON eurephia_adminlog(sessionkey);
+CREATE VIEW eurephia_adminlog_update AS
+ SELECT sessionkey, status, last_action, logout
+ FROM eurephia_adminlog;
+CREATE RULE eurephia_adminlog_allow_update
+ AS ON UPDATE TO eurephia_adminlog_update
+ DO INSTEAD UPDATE eurephia_adminlog
+ SET status = NEW.status, last_action = NEW.last_action,
+ logout = NEW.logout
+ WHERE sessionkey = OLD.sessionkey;
+
-- Table eurephia_adminaccesss: Defines which modules eurephia users have access to.
-- The access is defined per user account. uid refers
-- to the user account in the users table.