registry/internal/database/migrations
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Tadas Antanavicius e968cfdbca
fix: renumber migrations to fix staging deployment (#592)
## Summary

Fixes staging deployment by renumbering migrations to match what staging
has already applied.

## Problem

Staging already applied migration 008 (metadata separation) before we
inserted the new cleanup migration. When we added the cleanup as 008 and
renumbered metadata to 009, staging tried to apply 009 again and failed
with "column already exists".

## Current State

- **Staging**: Has run original 008 (metadata separation), marked as
complete. Failed trying to run 009 (which is the same migration
renumbered).
- **Production**: Has not run either 008 or 009 yet.

## Solution

- Rename `008_clean_invalid_data.sql` → `007a_clean_invalid_data.sql`
- Rename `009_separate_official_metadata.sql` →
`008_separate_official_metadata.sql` (back to original)

## How This Fixes It

With this renumbering:

1. **Staging behavior**:
- Sees 008 is already complete (the metadata migration it already ran)
- Sees 007a as new and runs it, but it will be a no-op (skips because
staging doesn't have the problematic production data)
   - Continues normally

2. **Production behavior**:
   - Runs 007a (cleanup migration) - removes invalid data
- Runs 008 (metadata separation) - applies successfully because data is
now clean
   - Both migrations run in the correct order as intended

## Testing

- Verified migration order works correctly
- Tested on empty database (test environment) - 007a skips as expected
- Tested with production data snapshot - 007a cleans data, 008 applies
successfully

This is a critical fix to unblock staging deployment.
2025-09-30 20:39:33 +03:00
..
001_initial_schema.sql Refactor database implementation to use PostgreSQL instead of MongoDB (#289) 2025-08-22 01:40:28 +01:00
002_add_server_extensions.sql Allow for vendor extensions on servers (#298) 2025-08-23 09:59:03 +01:00
003_simplify_to_key_value.sql Implement flattened _meta format for server extensions (#331) 2025-09-01 19:27:23 +01:00
004_update_meta_field_format.sql Fix _meta field format for MCP spec compliance (#367) 2025-09-08 11:40:04 -07:00
005_add_server_id_rename_version_id.sql Introduce serverId, rename id to versionId (#465) 2025-09-21 15:00:09 +03:00
006_migrate_server_json_camelcase.sql add migraiton file to convert snake case to camel case (#522) 2025-09-21 15:26:15 +03:00
007_add_publish_constraints.sql Fix race conditions in concurrent server publishing (#528) 2025-09-22 12:16:05 +01:00
007a_clean_invalid_data.sql fix: renumber migrations to fix staging deployment (#592) 2025-09-30 20:39:33 +03:00
008_separate_official_metadata.sql fix: renumber migrations to fix staging deployment (#592) 2025-09-30 20:39:33 +03:00