Skip to content

fix(database): convert forge_instance_id to uuid before 0008 on PostgreSQL - #921

Closed
cbartz wants to merge 1 commit into
cloudbase:mainfrom
cbartz:fix/postgres-forge-instance-id-uuid
Closed

cbartz wants to merge 1 commit into
cloudbase:mainfrom
cbartz:fix/postgres-forge-instance-id-uuid

Conversation

@cbartz

@cbartz cbartz commented Oct 15, 2026

Copy link
Copy Markdown
Contributor

Migration 0008 fails with operator does not exist: text = uuid on PostgreSQL databases that were migrated through 0003. On those databases, forge_instance_id in forge_instance_events, pools and workflow_jobs is text, while fresh databases get uuid. See #920.

On PostgreSQL, 0008 now converts those columns to uuid before its cleanup, so both the orphan cleanup and the foreign key creation work. Columns that are already uuid are left alone, so fresh databases are unaffected. SQLite is untouched.

TestConstraintParityOnPostgres now builds its pre-constraint database with text columns and a dangling forge_instance_id. Without the fix it fails with the same error we hit in production.

Fixes #920

…reSQL

Migration 0008 failed with "operator does not exist: text = uuid" on
PostgreSQL databases migrated through 0003. The 0003 stubs declare
forge_instance_id without the relation that gives fresh databases a uuid
column, so those databases have text columns that 0008 can neither
compare with nor constrain to forge_instances.id. Convert them first.

Fixes cloudbase#920
@cbartz cbartz closed this Oct 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Migration 0008 fails on PostgreSQL databases upgraded through 0003: operator does not exist: text = uuid

1 participant