mirror of
https://github.com/zyycn/codex-proxy-rs.git
synced 2026-11-29 00:01:06 +00:00
refactor(db): consolidate unreleased key validity and proxy target migrations
Co-authored-by: Codex <noreply@openai.com>
This commit is contained in:
@@ -46,5 +46,4 @@ aeff99fee7cef5a553ae49ffe27a48f49e31ccfb3fbc61a2482c9b109478202d 0041_account_m
|
||||
e115a71b80faa08be4cf4f8747eec01e7b855ad3d8aa9622ca70b57300847b54 0046_account_and_runtime_settings.sql
|
||||
98070edbfc34e71e403810fbb8db3bd18e7e241caeda2e952af022cd98ecdb6b 0047_request_plan_display.sql
|
||||
709df48f4dd067332177fb8bee15c5e75d4666a0dc9c7a8e48f8480a01a99908 0048_openai_runtime_settings.sql
|
||||
c7ade39b6c5026c1a728bf4e3e0d64c5d5b6aba1cf6fa13a64ca2b79172ab56c 0049_client_key_validity.sql
|
||||
d715793026842c42a17c2846bec46bd9f01e256b10594b33765bea8ac374e380 0050_proxy_test_targets.sql
|
||||
44a24ba1bab7630881b4eeac66806231d3a7040dd72a99b0475e1a0f20cfc540 0049_client_key_validity_and_proxy_test_targets.sql
|
||||
|
||||
@@ -1,7 +0,0 @@
|
||||
ALTER TABLE client_api_keys
|
||||
ADD COLUMN starts_at timestamptz,
|
||||
ADD COLUMN expires_at timestamptz,
|
||||
ADD CONSTRAINT client_api_keys_validity_order CHECK (
|
||||
(starts_at IS NULL AND expires_at IS NULL) OR
|
||||
(starts_at IS NOT NULL AND expires_at IS NOT NULL AND starts_at < expires_at)
|
||||
);
|
||||
@@ -0,0 +1,11 @@
|
||||
alter table client_api_keys
|
||||
add column starts_at timestamptz,
|
||||
add column expires_at timestamptz,
|
||||
add constraint client_api_keys_validity_order check (
|
||||
(starts_at is null and expires_at is null) or
|
||||
(starts_at is not null and expires_at is not null and starts_at < expires_at)
|
||||
);
|
||||
|
||||
alter table runtime_settings
|
||||
add column proxy_test_targets jsonb not null default '[]'::jsonb,
|
||||
add column proxy_test_targets_revision bigint not null default 1 check (proxy_test_targets_revision > 0);
|
||||
@@ -1,3 +0,0 @@
|
||||
alter table runtime_settings
|
||||
add column proxy_test_targets jsonb not null default '[]'::jsonb,
|
||||
add column proxy_test_targets_revision bigint not null default 1 check (proxy_test_targets_revision > 0);
|
||||
Reference in New Issue
Block a user