Support FK's switching between non-castable types

Open
#51 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
35/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Stale
Tech stack
go, postgres
Domain
databases

Research direction

Start by tracing plan validation and the foreign-key migration generation paths in this Go library, using the BIGINT-to-TIMESTAMP example as the incompatibility case. Confirm how PostgreSQL rejects the type switch, then verify that the generated migration drops and re-adds the FK and that validation no longer errors.

Written by the indexing model from the issue text.

Description

enhancement

Currently, if switching between incompatible types with a FK, plan validation will error. We need to identify if types are incompatible and drop and re-add the FK

This is probably a pretty rare operation , since the only incompatible type switches we currently support is BIGINT to TIMESTAMP

Dominant language
Go
Stars
884
Forks
82
PR merge metrics
No merged PRs in 30d

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from stripe/pg-schema-diff

All issues in stripe/pg-schema-diff

Similar issues

More Go issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.