Skip to content

Create reset_sequences rake task

In spite of migrating all data from the old website, their sequences are created as if there is no data on the database, that is, with 'last_value' equal to 1.

Creating new records (contents, for example) would, therefore, fail due to id conflicts.

This migration task solves this problem by updating all the sequence tables we have to MAX(id)+1. This assumes that all our entities' primary keys are the 'id' attribute which, fortunately, is true.

Merge request reports