refactor(tests): reformat code and update dependency management

- Reorganized import statements in adapter tests for better readability
- Replaced or_insert_with(Vec::new) with or_default() in test closures
- Updated Cargo.lock with new dependency versions and checksums
- Added TLS features to tonic dependency configuration
- Included sqlx, chrono, and uuid dependencies with specific features
- Added jsonwebtoken and arc-swap as project dependencies
- Reformatted assertion statements to comply with line length limits
- Adjusted base64 import order in engine codec module
- Updated protobuf include statement formatting
This commit is contained in:
zhenyi
2026-06-11 12:11:05 +08:00
parent 06e8ee96a5
commit 821537186e
111 changed files with 10458 additions and 385 deletions
+23
View File
@@ -0,0 +1,23 @@
-- Create message_thread before migrations that reference it.
-- Safe for existing databases because the table may already exist from 004.
BEGIN;
CREATE TABLE IF NOT EXISTS message_thread (
id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
channel_id UUID NOT NULL,
root_message_id UUID NOT NULL REFERENCES message(id) ON DELETE CASCADE,
created_by UUID NOT NULL,
replies_count BIGINT NOT NULL DEFAULT 0,
participants_count BIGINT NOT NULL DEFAULT 0,
last_reply_message_id UUID NULL REFERENCES message(id) ON DELETE SET NULL,
last_reply_at TIMESTAMPTZ NULL,
resolved BOOLEAN NOT NULL DEFAULT FALSE,
resolved_by UUID NULL,
resolved_at TIMESTAMPTZ NULL,
created_at TIMESTAMPTZ NOT NULL DEFAULT now(),
updated_at TIMESTAMPTZ NOT NULL DEFAULT now(),
CONSTRAINT uq_message_thread_root UNIQUE (root_message_id)
);
COMMIT;