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 committed Jun 11, 2024
1 parent cbdd209 commit 3258b8e
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 @@ -322,7 +322,7 @@ CREATE TABLE browser_session (
php_session_id varchar(256) NOT NULL,
username varchar(254) 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/026.sql
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,8 @@ ALTER TABLE IF EXISTS browser_session
ALTER TABLE IF EXISTS browser_session
ADD CONSTRAINT pk_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 3258b8e

Please sign in to comment.