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

Maintain order of fields in the table structure #75

Open
gene-pavlovsky opened this issue Feb 22, 2019 · 2 comments
Open

Maintain order of fields in the table structure #75

gene-pavlovsky opened this issue Feb 22, 2019 · 2 comments

Comments

@gene-pavlovsky
Copy link
Member

Looking at the generated tables structure, it looks like the fields are added in alphabetical order, not the order they are declared in the type definitions. That means that, for example, the primary auto-increment id key can be somewhere in the middle instead of first, it looks quite messy this way when looking at the data in phpMyAdmin for example.
Is that a limitation of how macros work, or would it be possible to maintain the original declaration order from the data type definitions?

@back2dos
Copy link
Member

IIRC haxe orders fields of anonymous types alphabetically (I assume this makes unification between structures faster). I guess we could try to restore order via field position though.

@benmerckx
Copy link
Member

I don't remember this happening before, so I'm guessing newer haxe versions supply fields in a different order. We rely on field order here too:
#47 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants