0 votes

When I import a Laravel/Eloquent ORM through a connection to MySQL, the entities all list the fields in alphabetical order instead of the order in which the fields are listed in the actual DB table. Is there a way to achieve this with the current version? If not, I'd like to make that a feature request.

Thanks,
Stephen Dukes

in Solved by (260 points)
recategorized by

I'm confused as well, and maybe I'm missing a feature. To my understanding, I AM creating a new Skipper project. I start the project by clicking the "Import existing project" button from the home screen, do the MySql import, select the filesystem location for the new project, and when I'm done, there is a new project listed with the tables from the import. The only issue was that when all tables are empty, the import results in all the entities listing fields in alphabetical order.

Are you saying it's better to "Create a new project" and then import into that project? I figured doing it all in one operation was better....

On the SSH tunnel, I've used Navicat since the late 90s ( https://www.navicat.com/en/products/navicat-for-mysql ). It runs on all platforms and allows DB connections using an SSH tunnel. Maybe there is a way to collaborate with them? However, even without the SSH tunnel, Skipper is an awesome product.

I've also used this product for SSH tunneling on Windows: https://persistentssh.com

Skipper Get Started

ok, sorry for the confusion. You're doing that completely right. I thought you were importing it to an already created project.

But then I don't understand what you mean by "all tables are empty". Do you mean DB tables and empty as there are no records (only DQL structures imported)?

This should have no impact on import because Skipper queries only database structures, no data.

So what exactly did you mean by this?

Now that I know I need to load at least one table before running the ORM import, I'm good to go.

Because of that sentence, I thought you were creating a new empty project and then importing MySQL to the existing one. (my bad).

But now I still don't understand what do the difference between correctly ordered fields and alphabetically ordered fields.

But then I don't understand what you mean by "all tables are empty". Do you mean DB tables and empty as there are no records (only DQL structures imported)?

Yes, that is what I mean. I did a STRUCTURE-ONLY dump of the tables on my SSH-Only-Accessible server; Imported the dump file creating a local MySQL database with tables all of which contain no data. When I run the ORM Import on this database, the resulting Skipper project has the fields listed in alphabetical order for all tables (NOT in the order they appear in the actual MySQL table). When I load data into just one of the tables and re-run the import, the resulting Skipper project has all fields in the original table-order as expected. So, the workaround for my initial issue is to simply load at least one table with data before running the ORM Import.

Ok...seems that there is more to it than just the tables being empty. I ran the same procedure on a different DB and imported it with no data in the tables and it put the entity fields in the correct order. The only difference I can see between the DB that puts fields in alpha-order, and the one that doesn't is the one that puts fields in alpha-order has foreign keys on a few of the tables, and the one that puts the fields in the correct order has no foreign keys on any table. So, it's looking more and more like a fluke. If you like, I will send you the SQL dump that when imported into MySQL causes the alpha-order issue, but as far as I'm concerned this is resolved for me, and I hope I haven't wasted too much of your time. You guys really take customer service to the next level! Just so you know, I recommend Skipper to everyone I know that has a need for it.

Hi, thanks for the all details. Maybe we find a solution to this issue.

Can you please try latest beta uploaded here: https://www.skipper18.com/support/402/downloads-skipper-beta

Thanks

1 Answer

+1 vote
Best answer
by Skipper developer (141k points)