Skip to content

Commit

Permalink
(BIDS-2872) wip
Browse files Browse the repository at this point in the history
  • Loading branch information
guybrush committed Feb 15, 2024
1 parent d9d0760 commit 6d4552c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions db/migrations/20240125120000_add_ratelimits.sql
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@ CREATE INDEX IF NOT EXISTS idx_api_ratelimits_changed_at_valid_until ON api_rate
SELECT 'up SQL query - add table api_keys';
CREATE TABLE IF NOT EXISTS
api_keys (
api_key VARCHAR(256) NOT NULL UNIQUE,
user_id INT NOT NULL,
api_key VARCHAR(256) NOT NULL,
valid_until TIMESTAMP WITHOUT TIME ZONE NOT NULL DEFAULT '9999-12-31 23:59:59',
changed_at TIMESTAMP WITHOUT TIME ZONE NOT NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (user_id, api_key)
PRIMARY KEY (api_key)
);

CREATE INDEX IF NOT EXISTS idx_api_keys_changed_at_valid_until ON api_keys (changed_at, valid_until);
Expand Down

0 comments on commit 6d4552c

Please sign in to comment.