DatabaseCleaner / database_cleaner-active_record

Strategies for cleaning databases using ActiveRecord. Can be used to ensure a clean state for testing.
MIT License
64 stars 63 forks source link

For PG truncate, fetch last_value from sequence #103

Closed cwjenkins closed 4 months ago

cwjenkins commented 6 months ago

With HEAD, receiving ERROR: currval of sequence ... given currval isn't defined until nextval is invoked 'per session'. https://www.postgresql.org/docs/current/functions-sequence.html

Therefore looking up what's been persisted whether it was atomically incremented via nextval or manual shifted by something else.