Bug 1039309 - LiquidBase creates incorrect index
Summary: LiquidBase creates incorrect index
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: PressGang CCMS
Classification: Community
Component: REST-API
Version: 1.3
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
: 1.4
Assignee: Lee Newson
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2013-12-07 20:34 UTC by Matthew Casperson
Modified: 2014-08-04 22:27 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2014-02-23 23:43:52 UTC


Attachments (Terms of Use)

Description Matthew Casperson 2013-12-07 20:34:20 UTC
The index "TopicIDAndMinHashFuncID" creates an index against the topic id and minhasfuncid columns. This index should be against the MinHash and MinHashFuncID columns, as these are the ones that are queries for MinHash similarity.

Comment 1 Lee Newson 2013-12-08 22:01:47 UTC
I'm not sure why this is happening at a glance but either way that Index should not be in the Liquibase changelog as the index is created by:

<addUniqueConstraint tableName="MinHash" columnNames="TopicID, MinHashFuncID"/>

Comment 2 Lee Newson 2014-01-15 00:56:23 UTC
Removed the incorrect create index statement in 1.4-SNAPSHOT build 201401151042

Note: The CHECKSUM for that create table will now be different, so you will need to run the following SQL before updating to the build above:

UPDATE `DATABASECHANGELOG` SET `MD5SUM` = '3:c21aeed0c7f7471ca63b39147e20c9b3' WHERE `ID` = '1' AND  `AUTHOR` = 'mcaspers' AND `FILENAME` = 'db/changelog/db.changelog-1.3.xml';

Comment 3 Lee Newson 2014-01-15 02:55:03 UTC
This version is now live on the test/development server.

Comment 4 Lee Newson 2014-01-15 05:15:15 UTC
I've reverted the above as I read the original part wrong and this didn't work as expected. 

I've now fixed it as per the initial specification in 1.4-SNAPSHOT build 201401151504. I've also made it so it'll be entirely managed by liquibase so no custom SQL needs to be executed, as well as added an index on the MinHash revision table since it was missing.

If you did run the above SQL, then here is the SQL to change it back:

UPDATE `DATABASECHANGELOG` SET `MD5SUM` = '3:c2e4c45c83480fa8b3c399e4c725e0d6' WHERE `ID` = '1' AND  `AUTHOR` = 'mcaspers' AND `FILENAME` = 'db/changelog/db.changelog-1.3.xml';

Note: This version is now live on the test/development server.

Comment 5 Matthew Casperson 2014-01-28 06:04:15 UTC
Downloaded a SQL backup from the prod server, deployed the REST server and confirmed that Liquidbase executed correctly and created the correct index.


Note You need to log in before you can comment on or make changes to this bug.