# How to ignore sequence start value during diff

**URL:** <https://forum.liquibase.org/t/how-to-ignore-sequence-start-value-during-diff/7318>\
**Category:** General Discussion\
**Tags:** diff\
**Created:** [September 19, 2022, 8:36pm UTC](https://forum.liquibase.org/t/how-to-ignore-sequence-start-value-during-diff/7318 "2022-09-19T20:36:47Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![pbiggs](https://avatars.discourse-cdn.com/v4/letter/p/47e85d/32.png) [@pbiggs](https://forum.liquibase.org/u/pbiggs)\
**Post date:** [September 19, 2022, 8:36pm UTC](https://forum.liquibase.org/t/how-to-ignore-sequence-start-value-during-diff/7318/1 "2022-09-19T20:36:47Z")

</div>

I’m using Liquibase 4.8 because later versions have broken needed functionality.

I’m finding a couple of issues related to sequences when running `generatechangelog` against an oracle schema, requiring extensive edits before running the generated changelog to create a new schema.

1. The `startValue` is being set to the current value in the source schema. In most cases, when we build a new schema, we want this to be either the `minValue` or 1.
2. If the sequence includes the cycle option, then the `maxValue` must be specified for the command to run without error, however, the `maxValue` is missing from some (but not all) generated sequence changesets that have the `CYCLE` attribute, requiring these be edited to add the `maxValue`. e.g.:

```auto
-- changeset bigpet01-pa:1663277030155-8
CREATE SEQUENCE DATAFEED_ID_SEQ START WITH 523194 CYCLE;

-- changeset bigpet01-pa:1663277030155-9
CREATE SEQUENCE ETQ_SID_SEQ START WITH 15498321 MAXVALUE 9999999999999999999999999999 CYCLE;

```

When running a diff report where reference is set to the source schema where `generatechangelog` was run, against a new schema build from the generated changelog, I get differences for every sequence related to having to modify these values. E.g.

```auto
Changed Sequence(s):
     APP_ERR_LOG_ID_SEQ
          maxValue changed from 'null' to '9999999999999999999999999999'
          startValue changed from '8141319' to '1'

```

In addition, the diff-changelog command wants to alter every sequence but provides no changes. E.g.

```auto
-- liquibase formatted sql

-- changeset bigpet01-pa:1663616629511-1
ALTER SEQUENCE AD2_SID_SEQ;

-- changeset bigpet01-pa:1663616629511-2
ALTER SEQUENCE APPS_CAP_ID_SEQ;

-- changeset bigpet01-pa:1663616629511-3
ALTER SEQUENCE APP_ERR_LOG_ID_SEQ;

```

Is there a way to avoid such issues without having to write a bunch of post-processing code?

---

<div class="post-metadata">

**Author:** ![tabbyfoo](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.liquibase.org/tabbyfoo/32/748_2.png) [@tabbyfoo](https://forum.liquibase.org/u/tabbyfoo)\
**Post date:** [October 7, 2022, 4:51pm UTC](https://forum.liquibase.org/t/how-to-ignore-sequence-start-value-during-diff/7318/2 "2022-10-07T16:51:42Z")

</div>

Hi, @pbiggs - Thank you for asking this!

The answer to your question seems to be “it depends.” I did some searching and found a couple of resources that should help, but I couldn’t find a direct answer. Some of these reference posts are pretty old, so keep in mind that things may have been updated or changed, and the [documentation site](https://docs.liquibase.com) is always your best bet for the most up-to-date information.

1. [Ignore items in Liquibase diff - Stack Overflow](https://stackoverflow.com/questions/27636837/ignore-items-in-liquibase-diff)
2. [Syntax to eliminate Sequences from my createChangeLog command line call?](https://forum.liquibase.org/t/syntax-to-eliminate-sequences-from-my-createchangelog-command-line-call/1035)
3. [Best Practices for Using Diffs](https://forum.liquibase.org/t/best-practices-for-using-diffs/6085)
