# generateChangeLog doesn't generate createIndex changesLog-s on NUMBER foreign keys

**URL:** <https://forum.liquibase.org/t/generatechangelog-doesnt-generate-createindex-changeslog-s-on-number-foreign-keys/1192>\
**Category:** General Discussion\
**Created:** [March 29, 2011, 7:54pm UTC](https://forum.liquibase.org/t/generatechangelog-doesnt-generate-createindex-changeslog-s-on-number-foreign-keys/1192 "2011-03-29T19:54:00Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![ferengra](https://avatars.discourse-cdn.com/v4/letter/f/ac8455/32.png) [@ferengra](https://forum.liquibase.org/u/ferengra)\
**Post date:** [March 29, 2011, 7:54pm UTC](https://forum.liquibase.org/t/generatechangelog-doesnt-generate-createindex-changeslog-s-on-number-foreign-keys/1192/1 "2011-03-29T19:54:00Z")

</div>

Hi,

The&nbsp;generateChangeLog doesn’t generate the createIndex changeLog-s on NUMBER foreign keys (Long), just on unique and VARCHAR (String) keys.

If I have the next tables with two indices on Oracle:

CREATE TABLE STORED\_FILE (

&nbsp;&nbsp; &nbsp; &nbsp;ID NUMBER(19,0) NOT NULL,

&nbsp;&nbsp; &nbsp; &nbsp;FILE\_NAME VARCHAR(1000) NOT NULL,

&nbsp;&nbsp; &nbsp; &nbsp;CREATION\_USER VARCHAR(500) NOT NULL,

&nbsp;&nbsp; &nbsp; &nbsp;CREATION\_DATE TIMESTAMP(3) NOT NULL,

&nbsp;&nbsp; &nbsp; &nbsp;CONSTRAINT STORED\_FILE\_PK PRIMARY KEY (ID) USING INDEX TABLESPACE s\_indx) TABLESPACE s\_data;

CREATE INDEX s\_data.STOREDFILE\_USER\_IDX ON s\_data.STORED\_FILE(CREATION\_USER) TABLESPACE s\_indx;

CREATE TABLE DOCUMENT\_CONTENT (

&nbsp;&nbsp; &nbsp; &nbsp;ID NUMBER(19,0) NOT NULL,

&nbsp;&nbsp; &nbsp; &nbsp;CONTENTS VARCHAR(4000),

&nbsp;&nbsp; &nbsp; &nbsp;STORED\_FILE\_ID NUMBER(19,0) NOT NULL,

&nbsp;&nbsp; &nbsp; &nbsp;CONSTRAINT DOCUMENT\_CONTENT\_PK PRIMARY KEY (ID) USING INDEX TABLESPACE s\_indx) TABLESPACE s\_data;

ALTER TABLE s\_data.DOCUMENT\_CONTENT ADD CONSTRAINT DOCCON\_STOFILE\_FK FOREIGN KEY (STORED\_FILE\_ID) REFERENCES s\_data.STORED\_FILE (ID);

CREATE INDEX s\_data.DOCCON\_STFL\_IDX ON sip\_data.DOCUMENT\_CONTENT(STORED\_FILE\_ID) TABLESPACE s\_indx;

Only the changeLog for&nbsp;STOREDFILE\_USER\_IDX will be generated, but the&nbsp;DOCCON\_STFL\_IDX doesn’t.&nbsp;

&nbsp;changeSet author=“f (generated)” id=“1301402797638-3”

&nbsp;&nbsp;createIndex indexName=“STOREDFILE\_USER\_IDX” tableName=“STORED\_FILE” tablespace=“S\_INDX” unique=“false”&nbsp;column name=“CREATION\_USER”

&nbsp;/createIndex

/changeSet

The&nbsp;DOCCON\_STFL\_IDX is not a mandatory database constraint, the database structure is whole without it, but it’d boost the performance.

Can someone help me why the&nbsp;generateChangeLog doesn’t generate these performance boosting indices?

Our database are full of such indices, and creating them manually would be really time consuming…

Thanks,

&nbsp;&nbsp; Ferenc

---

<div class="post-metadata">

**Author:** ![nvoxland](https://avatars.discourse-cdn.com/v4/letter/n/87869e/32.png) [@nvoxland](https://forum.liquibase.org/u/nvoxland)\
**Post date:** [March 29, 2011, 7:54pm UTC](https://forum.liquibase.org/t/generatechangelog-doesnt-generate-createindex-changeslog-s-on-number-foreign-keys/1192/2 "2011-03-29T19:54:00Z")

</div>

The diff/generateChangeLog support does not support all database object types since we need to support so many different databases. Improving what is supported is the focus of 2.1 and I created an issue for this particular problem:

[http://liquibase.jira.com/browse/CORE-918](http://liquibase.jira.com/browse/CORE-918)

For now, it may be best to use a different tool to export your schema (or at least missing indexes) and move them into your changelog as blocks.

Nathan
