Skip to content

Migration Scripts broken using HasData and Postgres Enums #3778

@abarriosMagaya

Description

@abarriosMagaya

We have a table with a couple of fields as PostgreSQL enums.

We use HasData to seed some configuration Data.
When we generated the migration script, the enums used look like this 'allow'::main.security_permission_grant_type end as this Allow.

We are migrating our project to DotNet10, and this is blocking us.
The Postgres Enum is:

CREATE TYPE main.security_permission_grant_type AS ENUM
    ('notset', 'allow', 'deny', 'strict_allow', 'strict_deny');

ALTER TYPE main.security_permission_grant_type
    OWNER TO user001;

The C# Enums is:

namespace Service.Entity
{
	public enum SecurityPermissionGrant
	{
		NotSet,
		Allow,
		Deny,
		StrictAllow,
		StrictDeny
	}
}

We register the enums and PostgreSQL enums.

I created a mini Repo to recreate the Issue EnumsIssues with two branches dot-net-8 and dot-net-10

Metadata

Metadata

Assignees

No one assigned

    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