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

Change Type of PK #58

Open
lostatredrock opened this issue Mar 30, 2021 · 0 comments
Open

Change Type of PK #58

lostatredrock opened this issue Mar 30, 2021 · 0 comments

Comments

@lostatredrock
Copy link

The PK column in the history table is currently set to be an int with no straight forward method for providing an alternate type. In large scale systems this presents a hard cap on the number of history entries that can be created at a bit more than 2 billion. This is a large but not outrageously large value given that the table will log all changes written to the database. In addition most databases value uniqueness and speed over density when assigning int pk values so the actual number of records written can be significantly lower than ~2 billion. In practive in some of our high usage systems we are having to roll the audit table every couple of months.

We working on a work around that adds a value converter to the id property to "convert" the int ud to Guid.NewGuid(). This works to some degree but means we need to define a seperate model class to treat the audit log as a view if we want to retieve any data from it.

I think changing the type outright would probably present a major breaking problem for a number of applications but I think providing an option to inherit from a generic type would allow those that need it to define their own PK.

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

No branches or pull requests

1 participant