Skip to content

[SqlServer] when generating table, we should generate PKs first and FKs last (just like in EF6) - at the moment it is all in alphabetical order #412

Closed

Description

@maumar

I noticed that for models generated with EF7 the table view in SSMS is slightly different than it was in EF6. We used to create something like this:

Id (PK, int, not null)
Color (int, not null)
isLinked (bit, not null)
Item_Id (FK, int, not null)

with EF7 we generate:
Color (int, not null)
Id (PK, int, not null)
Item_Id (FK, int, not null)
isLinked (bit, not null)

We should consider following the old behaviour.

Activity

  1. rowanmiller commented on Jul 14, 2014

    @rowanmiller
    Contributor

    We should do the ordering coming out of the model differ, that way users can change the generated code.

  2. Repository owner unassigned on Sep 3, 2014
  3. ghost assigned on Sep 3, 2014
  4. jmalatia commented on Sep 7, 2015

    @jmalatia

    The rest of the columns should be created in the same order as written in the model... not alphabetical.... Just created a db with 7.0.0-beta7-15540 and it created the table columns in alphabetical order! I would expect it to create the table in the same order as the model is written as in EF6.

  5. modified the milestones: , 1.0.0 on Oct 15, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions