cakephp / cakephp/phinx

Support enums in postgres

Open
#2,258 5 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

feature
Dominant language
PHP
Stars
4.5k
Forks
884
PR merge metrics
No merged PRs in 30d

Description

Hi there, basically just checking to see if this something you all would consider adding. Postgres supports enums on columns but it's a two-step process where you make an enum type and then you set that type on the create like this:

CREATE TYPE mood AS ENUM ('sad', 'ok', 'happy');
CREATE TABLE person (
    name text,
    current_mood mood
);

More information at https://www.postgresql.org/docs/current/datatype-enum.html

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.

Research direction

Start by reviewing Phinx's database migration handling for PostgreSQL and the PostgreSQL enum documentation linked in the issue. Determine how the two-step enum type and table-column example should be represented, then add coverage for that schema once the supported behavior is defined.

Written by the indexing model from the issue text.

Assessment

Tech stack
php, postgresql
Domain
databases
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.