I often get the error:
error: nextval: reached maximum value of sequence "my_id_seq"
in django autogenerated ids. Postgres is able to easily deal with this using the CYCLE attribute of sequences. My current solution is to do this manually with:
ALTER SEQUENCE my_id_seq RESTART WITH 1;
or using a custom migration. Is there a clean django way to do this?