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.

Status

Complete. All Docker images upgraded, DB defaults migrated, 21 store functions updated.

Commit 1: Docker image version bumps

File Previous New Notes

devstack/postgres/Dockerfile:1

postgres:16-alpine

postgres:18-alpine

Adds native uuidv7()

devstack/rabbitmq/Dockerfile:1

rabbitmq:3.13-management-alpine

rabbitmq:4.2-management-alpine

AMQP 0.9.1 still supported

devstack/keycloak/Dockerfile:1

quay.io/keycloak/keycloak:26.0

quay.io/keycloak/keycloak:26.5

Minor version bump

Dockerfile:70-107 (8 stages)

alpine:3.21

alpine:3.23

All runtime stages

Dockerfile:108

postgresql16-client

postgresql-client

Unversioned tracks PG 18

.gitlab-ci.yml:28

ANTORA_IMAGE_TAG: "latest"

ANTORA_IMAGE_TAG: "3.1"

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

20260305100000_uuid_v7_defaults.sql

rule_sets, rule_evaluations

craig-cases

20260305100000_uuid_v7_defaults.sql

12 tables (persons through case_milestones)

craig-placement

20260305100000_uuid_v7_defaults.sql

foster_homes, foster_home_training, placements, kinship_options, sibling_placements

craig-financial

20260305100000_uuid_v7_defaults.sql

rate_tables, payments, payment_adjustments, claiming_records

craig-reporting

20260305100000_uuid_v7_defaults.sql

data_quality_issues, afcars_submissions, ncands_submissions, data_quality_metrics

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.

Commit 4: Documentation

Updated MEMORY.md and deployment docs with new version numbers.

Edit this page · latest