In my Java project, I have a sequence called room_id_seq
and after updating some inheritance in Spring Data JPA, now I need to drop and recreate this sequence starting from the last value + 1 from the dropped one. For example, if the last value of room_id_seq
is 100, then after dropping it my newly created room_id_seq
will start from 101.
So, how can I write sql to achieve this? Should I use a new name for new sequence and after creating it using the last value of previous, should I drop previous one?