Skip to content

PostgreSQL sink: data migration from mongo/fs to postgres #1557

Description

@dcoric

Follow-up to #1497 (PostgreSQL sink backend, added in #1532).

The postgres sink bootstraps an empty schema but provides no path to move existing data from the fs or mongo backends.

Decision needed first

users._id and repos._id are UUID columns (gen_random_uuid()), but mongo _ids are 24-char ObjectId hex strings, which are not valid UUIDs. The migration must either:

  • regenerate IDs on import (repos are looked up by URL, users by username, and pushes reference repos by URL, so this is mostly safe — but /repo/:id links would change), or
  • change those columns to TEXT to preserve the originals.

Scope

A documented, scripted migration (fs / mongopostgres). The adapter's idempotent upserts (writeAudit, createRepo, createUser / updateUser) can be reused by the importer.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions