Plan: Docker Image Upgrades + UUIDv7 Migration
On this page
Context
Docker images in the devstack were outdated (PostgreSQL 16, RabbitMQ 3.13, Keycloak 26.0, Alpine 3.21). Additionally, 21 store functions across 4 services relied on PostgreSQL’s gen_random_uuid() (UUIDv4) for primary keys, violating the project’s UUIDv7 architectural decision. The craig_common::id::new_id() function already generates UUIDv7 via Uuid::now_v7(), and the uuid crate already had the v7 feature enabled — but most services did not use it.
Upgrading PostgreSQL to 18 provides the native uuidv7() function for DB defaults.
Commit 1: Docker image version bumps
| File | Previous | New | Notes |
|---|---|---|---|
|
|
|
Adds native |
|
|
|
AMQP 0.9.1 still supported |
|
|
|
Minor version bump |
|
|
|
All runtime stages |
|
|
|
Unversioned tracks PG 18 |
|
|
|
Pin to specific version |
Commit 2: DB default migrations
One new migration per service changing gen_random_uuid() to uuidv7():
| Service | Migration file | Tables altered |
|---|---|---|
craig-rules |
|
|
craig-cases |
|
12 tables (persons through case_milestones) |
craig-placement |
|
|
craig-financial |
|
|
craig-reporting |
|
|
Commit 3: Application-layer UUIDv7 in store functions
21 functions updated across 4 services to explicitly generate UUIDs via craig_common::id::new_id():
-
craig-cases: 10 functions (persons, referrals, allegations, investigations, safety assessments, cases, case plans, tasks, contacts, court orders)
-
craig-placement: 5 functions (foster homes, training, placements, kinship, sibling placements)
-
craig-rules: 2 functions (rule sets, evaluations)
-
craig-reporting: 4 functions (issues, AFCARS submissions, NCANDS submissions, metrics)
Already using new_id() (no changes): craig-exchange (all), craig-financial (all), craig-cases contact_attachments.