Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/#100 improve performance qoh job #111

Merged
merged 6 commits into from
Oct 4, 2015
Next Next commit
added unique constraint to inventory snapshot tables to allow update …
…on duplicate key during batch insert operation
  • Loading branch information
jmiranda committed Oct 4, 2015
commit d96afb8a9fea177282b4010437a1fd05a67951dd
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>
2 changes: 1 addition & 1 deletion grails-app/migrations/0.6.x/changelog.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@
<include file="0.6.x/modify-column-order-unit-price.xml"/>
<include file="0.6.x/create-table-inventory-item-snapshot.xml"/>
<include file="0.6.x/add-column-user-timezone.xml"/>

<include file="0.6.x/add-unique-index-to-snapshot-tables.xml"/>
</databaseChangeLog>