Skip to content

Commit ade74a5

Browse files
yoyo930021claude
andcommitted
fix: remove uuid-ossp extension dependency for CI compatibility
The embedded PostgreSQL in CI lacks libossp-uuid shared library. Since UUID v7 is generated at the application layer (Rust uuid crate), uuid-ossp is unnecessary. Use pgcrypto's gen_random_uuid() for tests. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 226cc62 commit ade74a5

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

migrations/0001_init.sql

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
-- Enable required PostgreSQL extensions
2-
CREATE EXTENSION IF NOT EXISTS "uuid-ossp";
2+
-- Note: uuid-ossp is NOT used; UUID v7 is generated at the application layer
3+
-- pgcrypto provides gen_random_uuid() and cryptographic functions
34
CREATE EXTENSION IF NOT EXISTS "pgcrypto";

tests/db_test.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,13 @@ async fn test_database_connection_and_migration() {
1515
}
1616

1717
#[tokio::test]
18-
async fn test_uuid_extension_available() {
18+
async fn test_pgcrypto_extension_available() {
1919
let ctx = TestContext::new().await;
2020

21-
let row: (uuid::Uuid,) = sqlx::query_as("SELECT uuid_generate_v4()")
21+
let row: (uuid::Uuid,) = sqlx::query_as("SELECT gen_random_uuid()")
2222
.fetch_one(&ctx.pool)
2323
.await
24-
.expect("uuid-ossp extension should be available");
24+
.expect("pgcrypto extension should be available");
2525

2626
assert_eq!(row.0.get_version_num(), 4);
2727
}

0 commit comments

Comments
 (0)