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

Move to IDENTITY column for ordering? #69

Closed
CumpsD opened this issue Mar 1, 2020 · 4 comments · Fixed by #84
Closed

Move to IDENTITY column for ordering? #69

CumpsD opened this issue Mar 1, 2020 · 4 comments · Fixed by #84

Comments

@CumpsD
Copy link
Member

CumpsD commented Mar 1, 2020

ordering BIGINT NOT NULL GENERATED ALWAYS AS IDENTITY PRIMARY KEY,

Seems to be here:

As to the why:

If you want I can make a PR

Downside: PostgreSQL 10 and up only

@Aaronontheweb Aaronontheweb added this to the 1.4.16 milestone Feb 8, 2021
@Aaronontheweb Aaronontheweb added this to Needs triage in Akka.NET Sprint 2/8 - 2/22 via automation Feb 8, 2021
@Aaronontheweb
Copy link
Member

@akkadotnet/core is there a way we can add this retroactively? Always want to avoid breaking changes if possible.

@to11mtm
Copy link
Member

to11mtm commented Feb 9, 2021

@akkadotnet/core is there a way we can add this retroactively? Always want to avoid breaking changes if possible.

I think this is a little tricky since we would want to have this be 'opt-in' based on the version of Postgres. It could probably be handled via a (new) configuration option as far as changing upthe create table statement.

I'm not sure what the script we would need to migrate would look like (Postgres is not something I've really worked with in detail outside of linq2db usage, so I don't know how the type conversions work out...) But that might be more of a 'nice to have' than necessity, unless changing the type causes issues with the Other SQL used.

I did go ahead and create a related issue in Akka.Persistence.Linq2db since we will probably want to do the same there.

@IgorFedchenko
Copy link
Contributor

Does this change apply to only database table creation script? In this case, other queries will keep working without any changes, right? If so - yeah, we can give an option to use BIGINT IDENTITY when database is first time created, and that's it. Probably we could even not provide any migration script - Persistence queries will work with either column types equally. Or I am wrong and we use BIGSERIAL type somewhere else explicitly?

@Arkatufus Arkatufus moved this from Needs triage to Low priority in Akka.NET Sprint 2/8 - 2/22 Feb 9, 2021
@Arkatufus
Copy link
Contributor

I agree with @IgorFedchenko, if we do make this an opt-in feature and since it only affects table creation, we don't need to provide any migration tools.

@Arkatufus Arkatufus moved this from Low priority to In Review in Akka.NET Sprint 2/8 - 2/22 Mar 5, 2021
@Arkatufus Arkatufus moved this from In Review to Low priority in Akka.NET Sprint 2/8 - 2/22 Mar 5, 2021
Akka.Persistence.PostgreSql Modernization automation moved this from To do to Done Mar 15, 2021
@Arkatufus Arkatufus moved this from Low priority to Closed in Akka.NET Sprint 2/8 - 2/22 Mar 24, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
Development

Successfully merging a pull request may close this issue.

5 participants