Skip to content

Commit

Permalink
refactor: drop default statement for authenticated_at
Browse files Browse the repository at this point in the history
The PHP daemon now supplies the unix timestamp: Icinga/icinga-notifications-web@d1db5d4
  • Loading branch information
ncosta-ic authored and julianbrost committed Jun 13, 2024
1 parent 99348a0 commit 6b1a76b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion schema/pgsql/schema.sql
Original file line number Diff line number Diff line change
Expand Up @@ -348,7 +348,7 @@ CREATE TABLE browser_session (
php_session_id varchar(256) NOT NULL,
username citext NOT NULL,
user_agent varchar(4096) NOT NULL,
authenticated_at bigint NOT NULL DEFAULT (EXTRACT(EPOCH FROM CURRENT_TIMESTAMP) * 1000),
authenticated_at bigint NOT NULL,

CONSTRAINT pk_browser_session PRIMARY KEY (php_session_id)
);
Expand Down
3 changes: 3 additions & 0 deletions schema/pgsql/upgrades/029.sql
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,8 @@ ALTER TABLE browser_session
ALTER TABLE browser_session
ADD CONSTRAINT pk_browser_session PRIMARY KEY (php_session_id);

ALTER TABLE IF EXISTS browser_session
ALTER COLUMN authenticated_at DROP DEFAULT;

CREATE INDEX idx_browser_session_authenticated_at ON browser_session (authenticated_at DESC);
CREATE INDEX idx_browser_session_username_agent ON browser_session (username, user_agent);

0 comments on commit 6b1a76b

Please sign in to comment.