drizzle-team / drizzle-team/drizzle-orm

[FEATURE]: Add IF NOT EXISTS when adding new values to existing POSTGRES custom types

Open
#1,854 7 comments 3 reactions 0 assignees View on GitHub
db/postgres drizzle/kit enhancement
Dominant language
TypeScript
Stars
35.8k
Forks
1.6k
Avg merge
2d 7h
Merged PRs (30d)
4

Description

### Describe what you want

When we add new values to existing POSTGRES custom type DrizzleORM generates SQL like below:

`ALTER TYPE "custom_type" ADD VALUE "type3"`

But it will be safer if generates SQL like below:

`ALTER TYPE "custom_type" ADD VALUE IF NOT EXISTS "type3"`

Contributor guide

Open the contributing guide

Research direction

The issue names no files or tests. Start by locating the PostgreSQL migration SQL generation for adding values to existing custom types and compare its current statement with the requested one. Done means generated SQL uses IF NOT EXISTS and the relevant migration tests pass.

Written by the indexing model from the issue text.

Assessment

Tech stack
postgresql, typescript
Domain
databases
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.