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

Truncate to last x records #7

Closed
cimm opened this issue Jun 11, 2014 · 2 comments
Closed

Truncate to last x records #7

cimm opened this issue Jun 11, 2014 · 2 comments

Comments

@cimm
Copy link

cimm commented Jun 11, 2014

Is there a way to truncate the data to the last (or first) x records?

Production databases often contain more data than needed in development. Say I have an invoices table with a few 1000 records. I obviously need them in production but, to keep my development database small and fast, I probably only want to keep like 10 or so in development.

Thanks.

@cantino
Copy link
Owner

cantino commented Jun 13, 2014

Hey @cimm! So, that would be technically easy to add, but the challenge is that you likely want to maintain referential integrity, which is difficult when truncating tables. If that doesn't matter, modifying my_obfuscate to keep a row count per table shouldn't be hard.

@cimm
Copy link
Author

cimm commented Oct 30, 2014

Thank you, will close this issue. I understand it's a bit more complex as I thought at first sight.

@cimm cimm closed this as completed Oct 30, 2014
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

2 participants