wise-coders / dbschema

DbSchema Database Designer
https://dbschema.com
67 stars 3 forks source link

Issue with column order #87

Closed user72356 closed 1 year ago

user72356 commented 1 year ago

version 9.1.3 with Postgres

  1. When I generate a diagram, the columns are ordered as in the database (as expected).

  2. If I manually change the column order within DbSchema, and then refresh the diagram from the database, the manual order remains (this might be by design).

How can I restore the original database column order? I'm not finding an option to do that on refresh. So I dropped the diagram entirely and created a new one (not ideal for a large diagram). Even after doing that, the manual order again remains. It's as if there was some hidden cache with the column order that I can't get rid of.

Did I miss an option to reset the order, or is there none? It would be ideal to have an option in the settings to specify that the order should be reset on refresh.

wise-coders commented 1 year ago

Right now we don't remember the column order. Most of the databases doesn't ensure the column order. I can create a ticket for the development, to save the original order.

user72356 commented 1 year ago

Sorry, I'm confused about your answer. I just wanted to display the order of columns in DbSchema the same as in the database (which would be the creation order in most DBs, as your noted).

  1. I create a new layout in DbSchema. The columns are displayed in the same order as shown in a SELECT * query. That's fine.
  2. I change the column order within the layout to some custom order.
  3. I delete the layout.
  4. I create a new layout. I expect to see the same order as in step 1 (SELECT * query). Instead, my custom order from step 2 remains. It's weird and unexpected because if I delete a layout and then create a new one, there should not be any settings left over from the deleted layout.
wise-coders commented 1 year ago

Right now the column order is hold only in the table itself. The layout references only the layout. We have in plan to add more logic related to the column order.