-
-
Notifications
You must be signed in to change notification settings - Fork 399
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
…ce-qoh-job Feature/#100 improve performance of automated inventory snapshot process
- Loading branch information
Showing
7 changed files
with
164 additions
and
117 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
33 changes: 33 additions & 0 deletions
33
grails-app/migrations/0.6.x/add-unique-index-to-snapshot-tables.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<databaseChangeLog xmlns="http:https://www.liquibase.org/xml/ns/dbchangelog/1.9" | ||
xmlns:xsi="http:https://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http:https://www.liquibase.org/xml/ns/dbchangelog/1.9 http:https://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-1.9.xsd"> | ||
|
||
<changeSet author="jmiranda" id="1442807680525-1"> | ||
<addUniqueConstraint constraintName="inventory_snapshot_key" | ||
tableName="inventory_snapshot" | ||
columnNames="date, location_id, product_id"/> | ||
</changeSet> | ||
|
||
<changeSet author="jmiranda" id="1442807680525-2"> | ||
<addUniqueConstraint constraintName="inventory_item_snapshot_key" | ||
tableName="inventory_item_snapshot" | ||
columnNames="date, location_id, product_id, inventory_item_id"/> | ||
</changeSet> | ||
|
||
|
||
<!-- | ||
<changeSet author="jmiranda" id="1442807680525-3"> | ||
<comment>Need to update the ID column for all records so that they are set to an auto-incremented value during modify column operation.</comment> | ||
<sql> | ||
UPDATE inventory_snapshot set id = NULL; | ||
</sql> | ||
<modifyColumn tableName="inventory_snapshot"> | ||
<column name="id" type="bigint(20)" autoIncrement="true"> | ||
<constraints nullable="false" primaryKey="true" primaryKeyName="inventory_snapshot_pk"/> | ||
</column> | ||
</modifyColumn> | ||
</changeSet> | ||
--> | ||
|
||
</databaseChangeLog> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.