{"id":46517160,"url":"https://github.com/heymoon-cc/doctrine-psql-enum","last_synced_at":"2026-03-06T18:03:06.384Z","repository":{"id":229881019,"uuid":"695852295","full_name":"heymoon-cc/doctrine-psql-enum","owner":"heymoon-cc","description":"Doctrine migrations for PostgreSQL enum","archived":false,"fork":false,"pushed_at":"2026-02-15T11:03:27.000Z","size":57,"stargazers_count":23,"open_issues_count":4,"forks_count":4,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-02-15T16:29:59.774Z","etag":null,"topics":["doctrine-orm","postgresql"],"latest_commit_sha":null,"homepage":"https://packagist.org/packages/heymoon/doctrine-psql-enum","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/heymoon-cc.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2023-09-24T12:35:22.000Z","updated_at":"2026-02-15T10:56:05.000Z","dependencies_parsed_at":"2024-03-26T19:21:39.347Z","dependency_job_id":"acc60ccf-4d31-4e3b-b083-23e174ae020d","html_url":"https://github.com/heymoon-cc/doctrine-psql-enum","commit_stats":null,"previous_names":["heymoon-cc/doctrine-psql-enum"],"tags_count":13,"template":false,"template_full_name":null,"purl":"pkg:github/heymoon-cc/doctrine-psql-enum","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/heymoon-cc%2Fdoctrine-psql-enum","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/heymoon-cc%2Fdoctrine-psql-enum/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/heymoon-cc%2Fdoctrine-psql-enum/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/heymoon-cc%2Fdoctrine-psql-enum/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/heymoon-cc","download_url":"https://codeload.github.com/heymoon-cc/doctrine-psql-enum/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/heymoon-cc%2Fdoctrine-psql-enum/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30189483,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-06T17:33:53.563Z","status":"ssl_error","status_checked_at":"2026-03-06T17:33:51.678Z","response_time":250,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["doctrine-orm","postgresql"],"created_at":"2026-03-06T18:03:05.535Z","updated_at":"2026-03-06T18:03:06.376Z","avatar_url":"https://github.com/heymoon-cc.png","language":"PHP","readme":"# Doctrine enums for PostgreSQL\n[![Version](https://poser.pugx.org/heymoon/doctrine-psql-enum/v)](https://packagist.org/packages/heymoon/doctrine-psql-enum)\n[![PHP Version Require](https://poser.pugx.org/heymoon/doctrine-psql-enum/require/php)](https://packagist.org/packages/heymoon/doctrine-psql-enum)\n[![Test](https://github.com/heymoon-cc/doctrine-psql-enum/actions/workflows/test.yaml/badge.svg)](https://github.com/heymoon-cc/doctrine-psql-enum/actions/workflows/test.yaml)\n[![Maintainability](https://qlty.sh/badges/86677899-9f9f-40c8-95c7-b1200e029944/maintainability.svg)](https://qlty.sh/gh/heymoon-cc/projects/doctrine-psql-enum)\n[![Code Coverage](https://qlty.sh/badges/86677899-9f9f-40c8-95c7-b1200e029944/test_coverage.svg)](https://qlty.sh/gh/heymoon-cc/projects/doctrine-psql-enum)\n[![Matrix](https://img.shields.io/matrix/doctrine-psql-enum%3Aheymoon.cc?fetchMode=guest)](https://matrix.to/#/#doctrine-psql-enum:heymoon.cc)\n## Prerequisites: *Symfony 7 + Doctrine 3*\n\n### Installation\n`composer require heymoon/doctrine-psql-enum`\n\n### Usage\nCreate library configuration:\n\n`config/packages/doctrine_postgres_enum.yaml`\n```yaml\ndoctrine_postgres_enum:\n  type_name: enum\n  migrations:\n    enabled: true\n    comment_tag: DC2Enum\n```\nFor defining new enum type, [use native PHP enums](https://www.php.net/manual/language.types.enumerations.php):\n```php\nuse HeyMoon\\DoctrinePostgresEnum\\Attribute\\EnumType;\n\n#[EnumType('auth_status')]\nenum AuthStatus: string\n{\n    case New = 'new';\n    case Active = 'active';\n    case Inactive = 'inactive';\n    case Deleted = 'deleted';\n}\n\n#[EnumType('auth_service')]\nenum Service: string\n{\n    case Google = 'google';\n}\n```\nFor creation of enum-field in model, use `enum` as `type` value, `enumType` in `Column` attribute must be defined:\n```php\n#[ORM\\Entity(repositoryClass: AuthRepository::class)]\nclass Auth\n{\n    #[ORM\\Id]\n    #[ORM\\GeneratedValue(strategy: \"CUSTOM\")]\n    #[ORM\\CustomIdGenerator(class: \"doctrine.uuid_generator\")]\n    #[ORM\\Column(type: 'uuid')]\n    private Uuid $id;\n\n    #[ORM\\Column(type: 'enum', enumType: AuthStatus::class)]\n    private AuthStatus $status;\n\n    #[ORM\\Column(type: 'enum', enumType: Service::class)]\n    private Service $service;\n}\n```\nCreate migrations via `make:migration`. If enum was created or modified, the `CREATE TYPE`/`ALTER TYPE` calls would be added to migration. Example:\n```php\n$this-\u003eaddSql('DROP TYPE IF EXISTS auth_status');\n$this-\u003eaddSql('CREATE TYPE auth_status AS ENUM (\\'new\\',\\'active\\',\\'inactive\\',\\'deleted\\')');\n$this-\u003eaddSql('DROP TYPE IF EXISTS auth_service');\n$this-\u003eaddSql('CREATE TYPE auth_service AS ENUM (\\'google\\')');\n$this-\u003eaddSql('CREATE TABLE auth (id UUID NOT NULL, status auth_status NOT NULL, service auth_service NOT NULL, PRIMARY KEY(id))');\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fheymoon-cc%2Fdoctrine-psql-enum","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fheymoon-cc%2Fdoctrine-psql-enum","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fheymoon-cc%2Fdoctrine-psql-enum/lists"}