Merge remote-tracking branch 'origin/pr/416' into codex/pr-416-420-integration

# Conflicts:
#	crates/aether-data/src/lifecycle/bootstrap/postgres.rs
#	crates/aether-data/src/lifecycle/migrate/tests.rs
This commit is contained in:
fawney19
2026-05-10 18:44:19 +08:00
11 changed files with 522 additions and 54 deletions

View File

@@ -352,7 +352,8 @@ CREATE TABLE IF NOT EXISTS public.management_tokens (
token_prefix character varying(12),
name character varying(100) NOT NULL,
description text,
allowed_ips json,
allowed_ips jsonb,
permissions jsonb,
expires_at timestamp with time zone,
last_used_at timestamp with time zone,
last_used_ip character varying(45),
@@ -360,7 +361,7 @@ CREATE TABLE IF NOT EXISTS public.management_tokens (
is_active boolean DEFAULT true NOT NULL,
created_at timestamp with time zone DEFAULT now() NOT NULL,
updated_at timestamp with time zone DEFAULT now() NOT NULL,
CONSTRAINT check_allowed_ips_not_empty CHECK (((allowed_ips IS NULL) OR ((allowed_ips)::text = 'null'::text) OR (json_array_length(allowed_ips) > 0)))
CONSTRAINT check_allowed_ips_not_empty CHECK (CASE WHEN ((allowed_ips IS NULL) OR (allowed_ips = 'null'::jsonb)) THEN true WHEN (jsonb_typeof(allowed_ips) = 'array'::text) THEN (jsonb_array_length(allowed_ips) > 0) ELSE false END)
);

View File

@@ -351,7 +351,8 @@ CREATE TABLE IF NOT EXISTS public.management_tokens (
token_prefix character varying(12),
name character varying(100) NOT NULL,
description text,
allowed_ips json,
allowed_ips jsonb,
permissions jsonb,
expires_at timestamp with time zone,
last_used_at timestamp with time zone,
last_used_ip character varying(45),
@@ -359,7 +360,7 @@ CREATE TABLE IF NOT EXISTS public.management_tokens (
is_active boolean DEFAULT true NOT NULL,
created_at timestamp with time zone DEFAULT now() NOT NULL,
updated_at timestamp with time zone DEFAULT now() NOT NULL,
CONSTRAINT check_allowed_ips_not_empty CHECK (((allowed_ips IS NULL) OR ((allowed_ips)::text = 'null'::text) OR (json_array_length(allowed_ips) > 0)))
CONSTRAINT check_allowed_ips_not_empty CHECK (CASE WHEN ((allowed_ips IS NULL) OR (allowed_ips = 'null'::jsonb)) THEN true WHEN (jsonb_typeof(allowed_ips) = 'array'::text) THEN (jsonb_array_length(allowed_ips) > 0) ELSE false END)
);