Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
陈曦
sub2api
Commits
5f3debf6
"frontend/vscode:/vscode.git/clone" did not exist on "33bae6f49b61424ffe2c81d1e2705b1b6042cd51"
Commit
5f3debf6
authored
Mar 03, 2026
by
shaw
Browse files
chore: add migration for api key rate limit fields
parent
fd8ef275
Changes
1
Show whitespace changes
Inline
Side-by-side
backend/migrations/064_add_api_key_rate_limits.sql
0 → 100644
View file @
5f3debf6
-- Add rate limit fields to api_keys table
-- Rate limit configuration (0 = unlimited)
ALTER
TABLE
api_keys
ADD
COLUMN
IF
NOT
EXISTS
rate_limit_5h
decimal
(
20
,
8
)
NOT
NULL
DEFAULT
0
;
ALTER
TABLE
api_keys
ADD
COLUMN
IF
NOT
EXISTS
rate_limit_1d
decimal
(
20
,
8
)
NOT
NULL
DEFAULT
0
;
ALTER
TABLE
api_keys
ADD
COLUMN
IF
NOT
EXISTS
rate_limit_7d
decimal
(
20
,
8
)
NOT
NULL
DEFAULT
0
;
-- Rate limit usage tracking
ALTER
TABLE
api_keys
ADD
COLUMN
IF
NOT
EXISTS
usage_5h
decimal
(
20
,
8
)
NOT
NULL
DEFAULT
0
;
ALTER
TABLE
api_keys
ADD
COLUMN
IF
NOT
EXISTS
usage_1d
decimal
(
20
,
8
)
NOT
NULL
DEFAULT
0
;
ALTER
TABLE
api_keys
ADD
COLUMN
IF
NOT
EXISTS
usage_7d
decimal
(
20
,
8
)
NOT
NULL
DEFAULT
0
;
-- Window start times (nullable)
ALTER
TABLE
api_keys
ADD
COLUMN
IF
NOT
EXISTS
window_5h_start
timestamptz
;
ALTER
TABLE
api_keys
ADD
COLUMN
IF
NOT
EXISTS
window_1d_start
timestamptz
;
ALTER
TABLE
api_keys
ADD
COLUMN
IF
NOT
EXISTS
window_7d_start
timestamptz
;
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment