Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Words attached together in property names of the object passed to CreateTable? #206

Open
aradalvand opened this issue Aug 1, 2023 · 3 comments
Milestone

Comments

@aradalvand
Copy link

aradalvand commented Aug 1, 2023

I don't think this actually makes a functional difference but it's still weird. Is this a known issue?
This is the sort of migration that gets generated for me — notice how the words in the property names of the object passed to columns aren't separated with an underscore, they are all lowercase and not cased properly:

migrationBuilder.CreateTable(
    name: "auth_codes",
    columns: table => new
    {
        id = table.Column<int>(type: "integer", nullable: false)
            .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityAlwaysColumn),
        mobilephonenumber = table.Column<string>(name: "mobile_phone_number", type: "character varying(11)", maxLength: 11, nullable: false),
        codehash = table.Column<string>(name: "code_hash", type: "text", nullable: false),
        createdat = table.Column<Instant>(name: "created_at", type: "timestamp with time zone", nullable: false),
        clientipaddress = table.Column<IPAddress>(name: "client_ip_address", type: "inet", nullable: true),
        conclusion = table.Column<AuthCodeConclusion>(type: "auth_code_conclusion", nullable: true),
        concludedat = table.Column<Instant>(name: "concluded_at", type: "timestamp with time zone", nullable: true)
    },
    constraints: table =>
    {
        table.PrimaryKey("pk_auth_codes", x => x.id);
    });

It didn't use to be like this in the past. I'm not sure exactly when it changed but I have older migrations that don't have this problem. Is this intentional?

@aradalvand aradalvand changed the title Words attached together in property names? Words attached together in property names of the object passed to CreateTable? Aug 1, 2023
@roji
Copy link
Member

roji commented Aug 1, 2023

Are you referring to the names of the properties on the anonymous type (id, mobilephonenumber)? I honestly have no idea - I don't think these matter in any functional way (as you wrote), but I also don't remember any intentional change here. Maybe something changed on the EF side that triggered this...

@aradalvand
Copy link
Author

aradalvand commented Aug 1, 2023

Yeah I'm referring to the properties on the anonymous type.
That's weird...
if you think this is worth investigating you can keep the issue open, otherwise feel free to close it.

@roji
Copy link
Member

roji commented Aug 1, 2023

We can keep this open - I may take a look at some point (though definitely not anytime soon). Always good to know these things!

@roji roji added this to the Backlog milestone Jan 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants