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

Native type of ID column does not matches with foreign keys #150

Open
beerbohmdo opened this issue Jun 29, 2023 · 3 comments
Open

Native type of ID column does not matches with foreign keys #150

beerbohmdo opened this issue Jun 29, 2023 · 3 comments

Comments

@beerbohmdo
Copy link

I don't know if this is a real "bug" of this module or a bad design choice in framework.

The ID column is serial8 which is a bigint (64bit).

All other ID columns (has_one, many_many) are integers (32bit).

I think instead of using DBInt for many_many and DBPolymorphicForeignKey they should use DBForeignKey internally, this would allow to use a custom schema for foreign keys.

@GuySartorelli
Copy link
Member

GuySartorelli commented Jun 30, 2023

Are you experiencing this with 2.x release line or the 3.x release line?
Please note that the 3.x release line is no longer commercially supported, and we're looking for maintainers (see https://docs.silverstripe.org/en/5/changelogs/5.0.0/#modules-not-supported-going-forward)

Can you please also explain specifically whether this is causing problems for you, and what those problems are? I get that these types aren't inconsistent and it might be better if they were... I'm just trying to understand if that's a bug per se or just something that could be improved.

@beerbohmdo
Copy link
Author

Can you please also explain specifically whether this is causing problems for you, and what those problems are?

No real problem yet. I don't even know how postgres handles a compare between two different integer types. But I had performance issues with Enum and a Varchar with different collation on MariaDB Databases in the past.

I have to migrate my database from MariaDB to PostgreSQL and I have some tables which have the potential to grow realy fast and even if I don't think that they will reach the maximal value of 32 bit in the near future, I liked the fact that the IDs in the PostgreSQL driver are already 64 bit based, until I saw that the references are still 32 bit.

@GuySartorelli
Copy link
Member

Okay, cool. Thanks for that context. Because this is an enhancement rather than a bug, it's not covered under the current support model for this module.

As mentioned above we're looking for maintainers, so if you're interested in looking after this module and implementing that enhancement I recommend checking out the link in my previous 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

2 participants