Commit 3628b3bf authored by Vincent Pelletier's avatar Vincent Pelletier

Add primary keys on tables:

 category
 inventory_stock
 item
 predicate_category
 stock


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@19525 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent cad972eb
......@@ -267,12 +267,14 @@ WHERE\n
\n
<dtml-var "\'\\0\'">\n
\n
<dtml-let row_list="[]">\n
<dtml-let row_list="[]" uid_dict="{}">\n
<dtml-in prefix="loop" expr="_.range(_.len(uid))">\n
<dtml-if expr="isInventoryMovement[loop_item] and isMovement[loop_item] and isAccountable[loop_item] and getResourceUid[loop_item]">\n
<dtml-if "isInventoryMovement[loop_item] and isMovement[loop_item] and isAccountable[loop_item] and getResourceUid[loop_item]">\n
<dtml-if "getDestinationUid[loop_item]">\n
<dtml-call expr="uid_dict.update({uid[loop_item]: uid_dict.get(uid[loop_item], -1) + 1})">\n
<dtml-call expr="row_list.append([\n
uid[loop_item], \n
uid_dict[uid[loop_item]],\n
getDestinationUid[loop_item],\n
getDestinationSectionUid[loop_item],\n
getDestinationPaymentUid[loop_item],\n
......@@ -291,8 +293,10 @@ WHERE\n
getSubVariationText[loop_item]])">\n
</dtml-if>\n
<dtml-if "getSourceUid[loop_item]">\n
<dtml-call expr="uid_dict.update({uid[loop_item]: uid_dict.get(uid[loop_item], -1) + 1})">\n
<dtml-call expr="row_list.append([\n
uid[loop_item], \n
uid_dict[uid[loop_item]],\n
getSourceUid[loop_item],\n
getSourceSectionUid[loop_item],\n
getSourcePaymentUid[loop_item],\n
......@@ -320,22 +324,23 @@ VALUES\n
<dtml-in prefix="row" expr="row_list">\n
(\n
<dtml-sqlvar expr="row_item[0]" type="int">,\n
<dtml-sqlvar expr="row_item[1]" type="int">, \n
<dtml-sqlvar expr="row_item[2]" type="int" optional>, \n
<dtml-sqlvar expr="row_item[3]" type="int" optional>, \n
<dtml-sqlvar expr="row_item[1]" type="int">,\n
<dtml-sqlvar expr="row_item[2]" type="int">,\n
<dtml-sqlvar expr="row_item[3]" type="int" optional>,\n
<dtml-sqlvar expr="row_item[4]" type="int" optional>,\n
<dtml-sqlvar expr="row_item[5]" type="int" optional>,\n
<dtml-sqlvar expr="row_item[6]" type="int" optional>,\n
<dtml-sqlvar expr="row_item[7]" type="int" optional>,\n
<dtml-sqlvar expr="row_item[8]" type="int">, \n
<dtml-sqlvar expr="row_item[9]" type="float" optional>,\n
<dtml-sqlvar expr="row_item[10]" type="datetime" optional>,\n
<dtml-sqlvar expr="row_item[8]" type="int" optional>,\n
<dtml-sqlvar expr="row_item[9]" type="int">, \n
<dtml-sqlvar expr="row_item[10]" type="float" optional>,\n
<dtml-sqlvar expr="row_item[11]" type="datetime" optional>,\n
<dtml-sqlvar expr="row_item[12]" type="float" optional>,\n
<dtml-sqlvar expr="row_item[13]" type="string" optional>,\n
<dtml-sqlvar expr="row_item[12]" type="datetime" optional>,\n
<dtml-sqlvar expr="row_item[13]" type="float" optional>,\n
<dtml-sqlvar expr="row_item[14]" type="string" optional>,\n
<dtml-sqlvar expr="row_item[15]" type="string" optional>,\n
<dtml-sqlvar expr="row_item[16]" type="string" optional>\n
<dtml-sqlvar expr="row_item[16]" type="string" optional>,\n
<dtml-sqlvar expr="row_item[17]" type="string" optional>\n
)\n
<dtml-if sequence-end><dtml-else>,</dtml-if>\n
</dtml-in>\n
......@@ -391,12 +396,14 @@ WHERE\n
\n
<dtml-var "\'\\0\'">\n
\n
<dtml-let row_list="[]">\n
<dtml-let row_list="[]" uid_dict="{}">\n
<dtml-in prefix="loop" expr="_.range(_.len(uid))">\n
<dtml-if expr="isInventoryMovement[loop_item] and isMovement[loop_item] and isAccountable[loop_item] and getResourceUid[loop_item]">\n
<dtml-if "isInventoryMovement[loop_item] and isMovement[loop_item] and isAccountable[loop_item] and getResourceUid[loop_item]">\n
<dtml-if "getDestinationUid[loop_item]">\n
<dtml-call expr="uid_dict.update({uid[loop_item]: uid_dict.get(uid[loop_item], -1) + 1})">\n
<dtml-call expr="row_list.append([\n
uid[loop_item], \n
uid_dict[uid[loop_item]],\n
getDestinationUid[loop_item],\n
getDestinationSectionUid[loop_item],\n
getDestinationPaymentUid[loop_item],\n
......@@ -415,8 +422,10 @@ WHERE\n
getSubVariationText[loop_item]])">\n
</dtml-if>\n
<dtml-if "getSourceUid[loop_item]">\n
<dtml-call expr="uid_dict.update({uid[loop_item]: uid_dict.get(uid[loop_item], -1) + 1})">\n
<dtml-call expr="row_list.append([\n
uid[loop_item], \n
uid_dict[uid[loop_item]],\n
getSourceUid[loop_item],\n
getSourceSectionUid[loop_item],\n
getSourcePaymentUid[loop_item],\n
......@@ -444,22 +453,23 @@ VALUES\n
<dtml-in prefix="row" expr="row_list">\n
(\n
<dtml-sqlvar expr="row_item[0]" type="int">,\n
<dtml-sqlvar expr="row_item[1]" type="int">, \n
<dtml-sqlvar expr="row_item[2]" type="int" optional>, \n
<dtml-sqlvar expr="row_item[3]" type="int" optional>, \n
<dtml-sqlvar expr="row_item[1]" type="int">,\n
<dtml-sqlvar expr="row_item[2]" type="int">,\n
<dtml-sqlvar expr="row_item[3]" type="int" optional>,\n
<dtml-sqlvar expr="row_item[4]" type="int" optional>,\n
<dtml-sqlvar expr="row_item[5]" type="int" optional>,\n
<dtml-sqlvar expr="row_item[6]" type="int" optional>,\n
<dtml-sqlvar expr="row_item[7]" type="int" optional>,\n
<dtml-sqlvar expr="row_item[8]" type="int">, \n
<dtml-sqlvar expr="row_item[9]" type="float" optional>,\n
<dtml-sqlvar expr="row_item[10]" type="datetime" optional>,\n
<dtml-sqlvar expr="row_item[8]" type="int" optional>,\n
<dtml-sqlvar expr="row_item[9]" type="int">, \n
<dtml-sqlvar expr="row_item[10]" type="float" optional>,\n
<dtml-sqlvar expr="row_item[11]" type="datetime" optional>,\n
<dtml-sqlvar expr="row_item[12]" type="float" optional>,\n
<dtml-sqlvar expr="row_item[13]" type="string" optional>,\n
<dtml-sqlvar expr="row_item[12]" type="datetime" optional>,\n
<dtml-sqlvar expr="row_item[13]" type="float" optional>,\n
<dtml-sqlvar expr="row_item[14]" type="string" optional>,\n
<dtml-sqlvar expr="row_item[15]" type="string" optional>,\n
<dtml-sqlvar expr="row_item[16]" type="string" optional>\n
<dtml-sqlvar expr="row_item[16]" type="string" optional>,\n
<dtml-sqlvar expr="row_item[17]" type="string" optional>\n
)\n
<dtml-if sequence-end><dtml-else>,</dtml-if>\n
</dtml-in>\n
......
......@@ -38,12 +38,6 @@
<dictionary/>
</value>
</item>
<item>
<key> <string>isMovement</string> </key>
<value>
<dictionary/>
</value>
</item>
<item>
<key> <string>uid</string> </key>
<value>
......@@ -57,9 +51,8 @@
<key> <string>_keys</string> </key>
<value>
<list>
<string>uid</string>
<string>isMovement</string>
<string>getCategoryList</string>
<string>uid</string>
<string>getCategoryList</string>
</list>
</value>
</item>
......@@ -77,7 +70,6 @@
<item>
<key> <string>arguments_src</string> </key>
<value> <string>uid\r\n
isMovement\r\n
getCategoryList</string> </value>
</item>
<item>
......@@ -125,43 +117,22 @@ WHERE\n
uid=<dtml-sqlvar sequence-item type="int"><dtml-if sequence-end><dtml-else> OR </dtml-if>\n
</dtml-in>\n
;\n
\n
<dtml-var "\'\\0\'">\n
\n
INSERT INTO category VALUES\n
<dtml-let category_list="[]">\n
<dtml-in prefix="loop" expr="_.range(_.len(uid))">\n
<dtml-if sequence-start><dtml-else>,</dtml-if>\n
<dtml-if expr="getCategoryList[loop_item]">\n
<dtml-let uid_list="portal_categories.getCategoryParentUidList(getCategoryList[loop_item])">\n
<dtml-if uid_list>\n
<dtml-in prefix="uid" expr="uid_list">\n
<dtml-if sequence-start><dtml-else>,</dtml-if>\n
(\n
<dtml-sqlvar expr="uid[loop_item]" type="int">,\n
<dtml-sqlvar expr="uid_item[0]" type="int">,\n
<dtml-sqlvar expr="uid_item[1]" type="int">,\n
<dtml-sqlvar expr="uid_item[2]" type="int">\n
)\n
</dtml-in> \n
<dtml-else>\n
(\n
<dtml-sqlvar expr="uid[loop_item]" type="int">,\n
NULL,\n
NULL,\n
1\n
)\n
</dtml-if>\n
</dtml-let>\n
<dtml-else>\n
(\n
<dtml-sqlvar expr="uid[loop_item]" type="int">,\n
NULL,\n
NULL,\n
1\n
)\n
</dtml-if>\n
</dtml-in> \n
<dtml-if expr="getCategoryList[loop_item]">\n
<dtml-let uid_list="portal_categories.getCategoryParentUidList(getCategoryList[loop_item])">\n
<dtml-if uid_list>\n
<dtml-in prefix="uid" expr="uid_list">\n
<dtml-call expr="category_list.append((uid[loop_item], uid_item[0], uid_item[1], uid_item[2]))">\n
</dtml-in></dtml-if></dtml-let></dtml-if></dtml-in>\n
<dtml-if expr="category_list">\n
INSERT INTO category VALUES\n
<dtml-in prefix="loop" expr="category_list">\n
(<dtml-sqlvar expr="loop_item[0]" type="int">, <dtml-sqlvar expr="loop_item[1]" type="int">, <dtml-sqlvar expr="loop_item[2]" type="int">, <dtml-sqlvar expr="loop_item[3]" type="int">)<dtml-if sequence-end><dtml-else>,</dtml-if>\n
</dtml-in>\n
</dtml-if>\n
</dtml-let>
]]></string> </value>
</item>
......@@ -170,9 +141,11 @@ INSERT INTO category VALUES\n
<value>
<object>
<klass>
<global name="SQL" module="Shared.DC.ZRDB.DA"/>
<global name="__newobj__" module="copy_reg"/>
</klass>
<none/>
<tuple>
<global name="SQL" module="Shared.DC.ZRDB.DA"/>
</tuple>
<state>
<dictionary>
<item>
......@@ -206,43 +179,22 @@ WHERE\n
uid=<dtml-sqlvar sequence-item type="int"><dtml-if sequence-end><dtml-else> OR </dtml-if>\n
</dtml-in>\n
;\n
\n
<dtml-var "\'\\0\'">\n
\n
INSERT INTO category VALUES\n
<dtml-let category_list="[]">\n
<dtml-in prefix="loop" expr="_.range(_.len(uid))">\n
<dtml-if sequence-start><dtml-else>,</dtml-if>\n
<dtml-if expr="getCategoryList[loop_item]">\n
<dtml-let uid_list="portal_categories.getCategoryParentUidList(getCategoryList[loop_item])">\n
<dtml-if uid_list>\n
<dtml-in prefix="uid" expr="uid_list">\n
<dtml-if sequence-start><dtml-else>,</dtml-if>\n
(\n
<dtml-sqlvar expr="uid[loop_item]" type="int">,\n
<dtml-sqlvar expr="uid_item[0]" type="int">,\n
<dtml-sqlvar expr="uid_item[1]" type="int">,\n
<dtml-sqlvar expr="uid_item[2]" type="int">\n
)\n
</dtml-in> \n
<dtml-else>\n
(\n
<dtml-sqlvar expr="uid[loop_item]" type="int">,\n
NULL,\n
NULL,\n
1\n
)\n
</dtml-if>\n
</dtml-let>\n
<dtml-else>\n
(\n
<dtml-sqlvar expr="uid[loop_item]" type="int">,\n
NULL,\n
NULL,\n
1\n
)\n
</dtml-if>\n
</dtml-in> \n
<dtml-if expr="getCategoryList[loop_item]">\n
<dtml-let uid_list="portal_categories.getCategoryParentUidList(getCategoryList[loop_item])">\n
<dtml-if uid_list>\n
<dtml-in prefix="uid" expr="uid_list">\n
<dtml-call expr="category_list.append((uid[loop_item], uid_item[0], uid_item[1], uid_item[2]))">\n
</dtml-in></dtml-if></dtml-let></dtml-if></dtml-in>\n
<dtml-if expr="category_list">\n
INSERT INTO category VALUES\n
<dtml-in prefix="loop" expr="category_list">\n
(<dtml-sqlvar expr="loop_item[0]" type="int">, <dtml-sqlvar expr="loop_item[1]" type="int">, <dtml-sqlvar expr="loop_item[2]" type="int">, <dtml-sqlvar expr="loop_item[3]" type="int">)<dtml-if sequence-end><dtml-else>,</dtml-if>\n
</dtml-in>\n
</dtml-if>\n
</dtml-let>
]]></string> </value>
</item>
......
......@@ -117,43 +117,22 @@ WHERE\n
uid=<dtml-sqlvar sequence-item type="int"><dtml-if sequence-end><dtml-else> OR </dtml-if>\n
</dtml-in>\n
;\n
\n
<dtml-var "\'\\0\'">\n
\n
INSERT INTO category VALUES\n
<dtml-let category_list="[]">\n
<dtml-in prefix="loop" expr="_.range(_.len(uid))">\n
<dtml-if sequence-start><dtml-else>,</dtml-if>\n
<dtml-if expr="getAcquiredCategoryList[loop_item]">\n
<dtml-let uid_list="portal_categories.getCategoryParentUidList(getAcquiredCategoryList[loop_item])">\n
<dtml-if uid_list>\n
<dtml-in prefix="uid" expr="uid_list">\n
<dtml-if sequence-start><dtml-else>,</dtml-if>\n
(\n
<dtml-sqlvar expr="uid[loop_item]" type="int">,\n
<dtml-sqlvar expr="uid_item[0]" type="int">,\n
<dtml-sqlvar expr="uid_item[1]" type="int">,\n
<dtml-sqlvar expr="uid_item[2]" type="int">\n
)\n
</dtml-in> \n
<dtml-else>\n
(\n
<dtml-sqlvar expr="uid[loop_item]" type="int">,\n
NULL,\n
NULL,\n
1\n
)\n
</dtml-if>\n
</dtml-let>\n
<dtml-else>\n
(\n
<dtml-sqlvar expr="uid[loop_item]" type="int">,\n
NULL,\n
NULL,\n
1\n
)\n
</dtml-if>\n
</dtml-in> \n
<dtml-if expr="getAcquiredCategoryList[loop_item]">\n
<dtml-let uid_list="portal_categories.getCategoryParentUidList(getAcquiredCategoryList[loop_item])">\n
<dtml-if uid_list>\n
<dtml-in prefix="uid" expr="uid_list">\n
<dtml-call expr="category_list.append((uid[loop_item], uid_item[0], uid_item[1], uid_item[2]))">\n
</dtml-in></dtml-if></dtml-let></dtml-if></dtml-in> \n
<dtml-if expr="category_list">\n
INSERT INTO category VALUES\n
<dtml-in prefix="loop" expr="category_list">\n
(<dtml-sqlvar expr="loop_item[0]" type="int">, <dtml-sqlvar expr="loop_item[1]" type="int">, <dtml-sqlvar expr="loop_item[2]" type="int">, <dtml-sqlvar expr="loop_item[3]" type="int">)<dtml-if sequence-end><dtml-else>,</dtml-if>\n
</dtml-in>\n
</dtml-if>\n
</dtml-let>
]]></string> </value>
</item>
......@@ -198,43 +177,22 @@ WHERE\n
uid=<dtml-sqlvar sequence-item type="int"><dtml-if sequence-end><dtml-else> OR </dtml-if>\n
</dtml-in>\n
;\n
\n
<dtml-var "\'\\0\'">\n
\n
INSERT INTO category VALUES\n
<dtml-let category_list="[]">\n
<dtml-in prefix="loop" expr="_.range(_.len(uid))">\n
<dtml-if sequence-start><dtml-else>,</dtml-if>\n
<dtml-if expr="getAcquiredCategoryList[loop_item]">\n
<dtml-let uid_list="portal_categories.getCategoryParentUidList(getAcquiredCategoryList[loop_item])">\n
<dtml-if uid_list>\n
<dtml-in prefix="uid" expr="uid_list">\n
<dtml-if sequence-start><dtml-else>,</dtml-if>\n
(\n
<dtml-sqlvar expr="uid[loop_item]" type="int">,\n
<dtml-sqlvar expr="uid_item[0]" type="int">,\n
<dtml-sqlvar expr="uid_item[1]" type="int">,\n
<dtml-sqlvar expr="uid_item[2]" type="int">\n
)\n
</dtml-in> \n
<dtml-else>\n
(\n
<dtml-sqlvar expr="uid[loop_item]" type="int">,\n
NULL,\n
NULL,\n
1\n
)\n
</dtml-if>\n
</dtml-let>\n
<dtml-else>\n
(\n
<dtml-sqlvar expr="uid[loop_item]" type="int">,\n
NULL,\n
NULL,\n
1\n
)\n
</dtml-if>\n
</dtml-in> \n
<dtml-if expr="getAcquiredCategoryList[loop_item]">\n
<dtml-let uid_list="portal_categories.getCategoryParentUidList(getAcquiredCategoryList[loop_item])">\n
<dtml-if uid_list>\n
<dtml-in prefix="uid" expr="uid_list">\n
<dtml-call expr="category_list.append((uid[loop_item], uid_item[0], uid_item[1], uid_item[2]))">\n
</dtml-in></dtml-if></dtml-let></dtml-if></dtml-in> \n
<dtml-if expr="category_list">\n
INSERT INTO category VALUES\n
<dtml-in prefix="loop" expr="category_list">\n
(<dtml-sqlvar expr="loop_item[0]" type="int">, <dtml-sqlvar expr="loop_item[1]" type="int">, <dtml-sqlvar expr="loop_item[2]" type="int">, <dtml-sqlvar expr="loop_item[3]" type="int">)<dtml-if sequence-end><dtml-else>,</dtml-if>\n
</dtml-in>\n
</dtml-if>\n
</dtml-let>
]]></string> </value>
</item>
......
......@@ -125,37 +125,22 @@ WHERE\n
uid=<dtml-sqlvar sequence-item type="int"><dtml-if sequence-end><dtml-else> OR </dtml-if>\n
</dtml-in>\n
;\n
\n
<dtml-var "\'\\0\'">\n
\n
<dtml-let predicate_list="[]">\n
<dtml-in prefix="loop" expr="_.range(_.len(uid))">\n
<dtml-if "isPredicate[loop_item]">\n
<dtml-call expr="predicate_list.append(loop_item)">\n
</dtml-if>\n
</dtml-in>\n
<dtml-if expr="_.len(predicate_list) > 0">\n
<dtml-let category_list="[]">\n
<dtml-in prefix="loop" expr="_.range(_.len(uid))">\n
<dtml-if expr="isPredicate[loop_item] and predicate_property_dict[loop_item].has_key(\'membership_criterion_category_list\')">\n
<dtml-let uid_list="portal_categories.getCategoryParentUidList(predicate_property_dict[loop_item][\'membership_criterion_category_list\'])">\n
<dtml-if uid_list>\n
<dtml-in prefix="uid" expr="uid_list">\n
<dtml-call expr="category_list.append((uid[loop_item], uid_item[0], uid_item[1], uid_item[2]))">\n
</dtml-in></dtml-if></dtml-let></dtml-if></dtml-in>\n
<dtml-if expr="category_list">\n
INSERT INTO predicate_category VALUES \n
<dtml-in prefix="loop" expr="predicate_list">\n
<dtml-if sequence-start><dtml-else>,</dtml-if>\n
<dtml-if "predicate_property_dict[loop_item].has_key(\'membership_criterion_category_list\')">\n
<dtml-let uid_list="portal_categories.getCategoryParentUidList(predicate_property_dict[loop_item][\'membership_criterion_category_list\'])">\n
<dtml-if uid_list>\n
<dtml-in "uid_list">\n
(<dtml-sqlvar expr="uid[loop_item]" type="int">, <dtml-var "_[\'sequence-item\'][0]" >, <dtml-var "_[\'sequence-item\'][1]" >, <dtml-var "_[\'sequence-item\'][2]" >)\n
<dtml-if sequence-end><dtml-else>,</dtml-if>\n
</dtml-in> \n
<dtml-else>\n
(<dtml-sqlvar expr="uid[loop_item]" type="int">, NULL, NULL,1)\n
</dtml-if>\n
</dtml-let>\n
<dtml-else>\n
(<dtml-sqlvar expr="uid[loop_item]" type="int">, NULL, NULL,1)\n
</dtml-if>\n
</dtml-in>\n
</dtml-if>\n
</dtml-let>\n
<dtml-in prefix="loop" expr="category_list">\n
<dtml-if sequence-start><dtml-else>,</dtml-if>(<dtml-sqlvar expr="loop_item[0]" type="int">, <dtml-sqlvar expr="loop_item[1]" type="int">, <dtml-sqlvar expr="loop_item[2]" type="int">, <dtml-sqlvar expr="loop_item[3]" type="int">)\n
</dtml-in>\n
</dtml-if>\n
</dtml-let>
]]></string> </value>
</item>
......@@ -200,37 +185,22 @@ WHERE\n
uid=<dtml-sqlvar sequence-item type="int"><dtml-if sequence-end><dtml-else> OR </dtml-if>\n
</dtml-in>\n
;\n
\n
<dtml-var "\'\\0\'">\n
\n
<dtml-let predicate_list="[]">\n
<dtml-in prefix="loop" expr="_.range(_.len(uid))">\n
<dtml-if "isPredicate[loop_item]">\n
<dtml-call expr="predicate_list.append(loop_item)">\n
</dtml-if>\n
</dtml-in>\n
<dtml-if expr="_.len(predicate_list) > 0">\n
<dtml-let category_list="[]">\n
<dtml-in prefix="loop" expr="_.range(_.len(uid))">\n
<dtml-if expr="isPredicate[loop_item] and predicate_property_dict[loop_item].has_key(\'membership_criterion_category_list\')">\n
<dtml-let uid_list="portal_categories.getCategoryParentUidList(predicate_property_dict[loop_item][\'membership_criterion_category_list\'])">\n
<dtml-if uid_list>\n
<dtml-in prefix="uid" expr="uid_list">\n
<dtml-call expr="category_list.append((uid[loop_item], uid_item[0], uid_item[1], uid_item[2]))">\n
</dtml-in></dtml-if></dtml-let></dtml-if></dtml-in>\n
<dtml-if expr="category_list">\n
INSERT INTO predicate_category VALUES \n
<dtml-in prefix="loop" expr="predicate_list">\n
<dtml-if sequence-start><dtml-else>,</dtml-if>\n
<dtml-if "predicate_property_dict[loop_item].has_key(\'membership_criterion_category_list\')">\n
<dtml-let uid_list="portal_categories.getCategoryParentUidList(predicate_property_dict[loop_item][\'membership_criterion_category_list\'])">\n
<dtml-if uid_list>\n
<dtml-in "uid_list">\n
(<dtml-sqlvar expr="uid[loop_item]" type="int">, <dtml-var "_[\'sequence-item\'][0]" >, <dtml-var "_[\'sequence-item\'][1]" >, <dtml-var "_[\'sequence-item\'][2]" >)\n
<dtml-if sequence-end><dtml-else>,</dtml-if>\n
</dtml-in> \n
<dtml-else>\n
(<dtml-sqlvar expr="uid[loop_item]" type="int">, NULL, NULL,1)\n
</dtml-if>\n
</dtml-let>\n
<dtml-else>\n
(<dtml-sqlvar expr="uid[loop_item]" type="int">, NULL, NULL,1)\n
</dtml-if>\n
</dtml-in>\n
</dtml-if>\n
</dtml-let>\n
<dtml-in prefix="loop" expr="category_list">\n
<dtml-if sequence-start><dtml-else>,</dtml-if>(<dtml-sqlvar expr="loop_item[0]" type="int">, <dtml-sqlvar expr="loop_item[1]" type="int">, <dtml-sqlvar expr="loop_item[2]" type="int">, <dtml-sqlvar expr="loop_item[3]" type="int">)\n
</dtml-in>\n
</dtml-if>\n
</dtml-let>
]]></string> </value>
</item>
......
......@@ -293,15 +293,14 @@ WHERE\n
\n
<dtml-var "\'\\0\'">\n
\n
<dtml-let row_list="[]">\n
<dtml-let row_list="[]" uid_dict="{}">\n
<dtml-in prefix="loop" expr="_.range(_.len(uid))">\n
<dtml-if "isMovement[loop_item]">\n
<dtml-if "not isInventoryMovement[loop_item]">\n
<dtml-if "isAccountable[loop_item]">\n
<dtml-if "getResourceUid[loop_item]">\n
<dtml-if "getDestinationUid[loop_item]">\n
<dtml-call expr="row_list.append([\n
<dtml-if "not(isInventoryMovement[loop_item]) and isMovement[loop_item] and isAccountable[loop_item] and getResourceUid[loop_item]">\n
<dtml-if "getDestinationUid[loop_item]">\n
<dtml-call expr="uid_dict.update({uid[loop_item]: uid_dict.get(uid[loop_item], -1) + 1})">\n
<dtml-call expr="row_list.append([\n
uid[loop_item], \n
uid_dict[uid[loop_item]],\n
getDestinationUid[loop_item],\n
getDestinationSectionUid[loop_item],\n
getDestinationPaymentUid[loop_item],\n
......@@ -318,10 +317,12 @@ WHERE\n
getSimulationState[loop_item], \n
getVariationText[loop_item],\n
getSubVariationText[loop_item]])">\n
</dtml-if>\n
<dtml-if "getSourceUid[loop_item]">\n
<dtml-call expr="row_list.append([\n
</dtml-if>\n
<dtml-if "getSourceUid[loop_item]">\n
<dtml-call expr="uid_dict.update({uid[loop_item]: uid_dict.get(uid[loop_item], -1) + 1})">\n
<dtml-call expr="row_list.append([\n
uid[loop_item], \n
uid_dict[uid[loop_item]],\n
getSourceUid[loop_item],\n
getSourceSectionUid[loop_item],\n
getSourcePaymentUid[loop_item],\n
......@@ -338,11 +339,8 @@ WHERE\n
getSimulationState[loop_item], \n
getVariationText[loop_item],\n
getSubVariationText[loop_item]])">\n
</dtml-if>\n
</dtml-if>\n
</dtml-if>\n
</dtml-if>\n
</dtml-if>\n
</dtml-in> \n
\n
<dtml-if "row_list">\n
......@@ -352,22 +350,23 @@ VALUES\n
<dtml-in prefix="row" expr="row_list">\n
(\n
<dtml-sqlvar expr="row_item[0]" type="int">,\n
<dtml-sqlvar expr="row_item[1]" type="int">, \n
<dtml-sqlvar expr="row_item[2]" type="int" optional>, \n
<dtml-sqlvar expr="row_item[1]" type="int">,\n
<dtml-sqlvar expr="row_item[2]" type="int">, \n
<dtml-sqlvar expr="row_item[3]" type="int" optional>, \n
<dtml-sqlvar expr="row_item[4]" type="int" optional>,\n
<dtml-sqlvar expr="row_item[4]" type="int" optional>, \n
<dtml-sqlvar expr="row_item[5]" type="int" optional>,\n
<dtml-sqlvar expr="row_item[6]" type="int" optional>,\n
<dtml-sqlvar expr="row_item[7]" type="int" optional>,\n
<dtml-sqlvar expr="row_item[8]" type="int">, \n
<dtml-sqlvar expr="row_item[9]" type="float" optional>,\n
<dtml-sqlvar expr="row_item[10]" type="datetime" optional>,\n
<dtml-sqlvar expr="row_item[8]" type="int" optional>,\n
<dtml-sqlvar expr="row_item[9]" type="int">, \n
<dtml-sqlvar expr="row_item[10]" type="float" optional>,\n
<dtml-sqlvar expr="row_item[11]" type="datetime" optional>,\n
<dtml-sqlvar expr="row_item[12]" type="float" optional>,\n
<dtml-sqlvar expr="row_item[13]" type="string" optional>,\n
<dtml-sqlvar expr="row_item[12]" type="datetime" optional>,\n
<dtml-sqlvar expr="row_item[13]" type="float" optional>,\n
<dtml-sqlvar expr="row_item[14]" type="string" optional>,\n
<dtml-sqlvar expr="row_item[15]" type="string" optional>,\n
<dtml-sqlvar expr="row_item[16]" type="string" optional>\n
<dtml-sqlvar expr="row_item[16]" type="string" optional>,\n
<dtml-sqlvar expr="row_item[17]" type="string" optional>\n
)\n
<dtml-if sequence-end><dtml-else>,</dtml-if>\n
</dtml-in>\n
......@@ -423,15 +422,14 @@ WHERE\n
\n
<dtml-var "\'\\0\'">\n
\n
<dtml-let row_list="[]">\n
<dtml-let row_list="[]" uid_dict="{}">\n
<dtml-in prefix="loop" expr="_.range(_.len(uid))">\n
<dtml-if "isMovement[loop_item]">\n
<dtml-if "not isInventoryMovement[loop_item]">\n
<dtml-if "isAccountable[loop_item]">\n
<dtml-if "getResourceUid[loop_item]">\n
<dtml-if "getDestinationUid[loop_item]">\n
<dtml-call expr="row_list.append([\n
<dtml-if "not(isInventoryMovement[loop_item]) and isMovement[loop_item] and isAccountable[loop_item] and getResourceUid[loop_item]">\n
<dtml-if "getDestinationUid[loop_item]">\n
<dtml-call expr="uid_dict.update({uid[loop_item]: uid_dict.get(uid[loop_item], -1) + 1})">\n
<dtml-call expr="row_list.append([\n
uid[loop_item], \n
uid_dict[uid[loop_item]],\n
getDestinationUid[loop_item],\n
getDestinationSectionUid[loop_item],\n
getDestinationPaymentUid[loop_item],\n
......@@ -448,10 +446,12 @@ WHERE\n
getSimulationState[loop_item], \n
getVariationText[loop_item],\n
getSubVariationText[loop_item]])">\n
</dtml-if>\n
<dtml-if "getSourceUid[loop_item]">\n
<dtml-call expr="row_list.append([\n
</dtml-if>\n
<dtml-if "getSourceUid[loop_item]">\n
<dtml-call expr="uid_dict.update({uid[loop_item]: uid_dict.get(uid[loop_item], -1) + 1})">\n
<dtml-call expr="row_list.append([\n
uid[loop_item], \n
uid_dict[uid[loop_item]],\n
getSourceUid[loop_item],\n
getSourceSectionUid[loop_item],\n
getSourcePaymentUid[loop_item],\n
......@@ -468,11 +468,8 @@ WHERE\n
getSimulationState[loop_item], \n
getVariationText[loop_item],\n
getSubVariationText[loop_item]])">\n
</dtml-if>\n
</dtml-if>\n
</dtml-if>\n
</dtml-if>\n
</dtml-if>\n
</dtml-in> \n
\n
<dtml-if "row_list">\n
......@@ -482,22 +479,23 @@ VALUES\n
<dtml-in prefix="row" expr="row_list">\n
(\n
<dtml-sqlvar expr="row_item[0]" type="int">,\n
<dtml-sqlvar expr="row_item[1]" type="int">, \n
<dtml-sqlvar expr="row_item[2]" type="int" optional>, \n
<dtml-sqlvar expr="row_item[1]" type="int">,\n
<dtml-sqlvar expr="row_item[2]" type="int">, \n
<dtml-sqlvar expr="row_item[3]" type="int" optional>, \n
<dtml-sqlvar expr="row_item[4]" type="int" optional>,\n
<dtml-sqlvar expr="row_item[4]" type="int" optional>, \n
<dtml-sqlvar expr="row_item[5]" type="int" optional>,\n
<dtml-sqlvar expr="row_item[6]" type="int" optional>,\n
<dtml-sqlvar expr="row_item[7]" type="int" optional>,\n
<dtml-sqlvar expr="row_item[8]" type="int">, \n
<dtml-sqlvar expr="row_item[9]" type="float" optional>,\n
<dtml-sqlvar expr="row_item[10]" type="datetime" optional>,\n
<dtml-sqlvar expr="row_item[8]" type="int" optional>,\n
<dtml-sqlvar expr="row_item[9]" type="int">, \n
<dtml-sqlvar expr="row_item[10]" type="float" optional>,\n
<dtml-sqlvar expr="row_item[11]" type="datetime" optional>,\n
<dtml-sqlvar expr="row_item[12]" type="float" optional>,\n
<dtml-sqlvar expr="row_item[13]" type="string" optional>,\n
<dtml-sqlvar expr="row_item[12]" type="datetime" optional>,\n
<dtml-sqlvar expr="row_item[13]" type="float" optional>,\n
<dtml-sqlvar expr="row_item[14]" type="string" optional>,\n
<dtml-sqlvar expr="row_item[15]" type="string" optional>,\n
<dtml-sqlvar expr="row_item[16]" type="string" optional>\n
<dtml-sqlvar expr="row_item[16]" type="string" optional>,\n
<dtml-sqlvar expr="row_item[17]" type="string" optional>\n
)\n
<dtml-if sequence-end><dtml-else>,</dtml-if>\n
</dtml-in>\n
......
......@@ -100,7 +100,7 @@ CREATE TABLE `category` (\n
`category_uid` BIGINT UNSIGNED default \'0\',\n
`base_category_uid` BIGINT UNSIGNED default \'0\',\n
`category_strict_membership` tinyint(1) default \'0\',\n
KEY `uid` (`uid`),\n
PRIMARY KEY (`uid`, `category_uid`, `base_category_uid`, `category_strict_membership`),\n
KEY `Membership` (`category_uid`,`base_category_uid`)\n
) TYPE = InnoDB;</string> </value>
</item>
......@@ -145,7 +145,7 @@ CREATE TABLE `category` (\n
`category_uid` BIGINT UNSIGNED default \'0\',\n
`base_category_uid` BIGINT UNSIGNED default \'0\',\n
`category_strict_membership` tinyint(1) default \'0\',\n
KEY `uid` (`uid`),\n
PRIMARY KEY (`uid`, `category_uid`, `base_category_uid`, `category_strict_membership`),\n
KEY `Membership` (`category_uid`,`base_category_uid`)\n
) TYPE = InnoDB;</string> </value>
</item>
......
......@@ -64,6 +64,7 @@
<key> <string>src</string> </key>
<value> <string>CREATE TABLE `inventory_stock` (\n
`uid` BIGINT UNSIGNED NOT NULL,\n
`order_id` TINYINT UNSIGNED NOT NULL,\n
`node_uid` BIGINT UNSIGNED,\n
`section_uid` BIGINT UNSIGNED,\n
`payment_uid` BIGINT UNSIGNED,\n
......@@ -80,7 +81,7 @@
`simulation_state` varchar(255) default \'\',\n
`variation_text` VARCHAR(255),\n
`sub_variation_text` VARCHAR(255),\n
KEY `uid` (`uid`),\n
PRIMARY KEY (`uid`, `order_id`),\n
KEY `quantity` (`quantity`),\n
KEY `section_uid` (`section_uid`),\n
KEY `mirror_section_uid` (`mirror_section_uid`),\n
......@@ -133,6 +134,7 @@
<key> <string>raw</string> </key>
<value> <string>CREATE TABLE `inventory_stock` (\n
`uid` BIGINT UNSIGNED NOT NULL,\n
`order_id` TINYINT UNSIGNED NOT NULL,\n
`node_uid` BIGINT UNSIGNED,\n
`section_uid` BIGINT UNSIGNED,\n
`payment_uid` BIGINT UNSIGNED,\n
......@@ -149,7 +151,7 @@
`simulation_state` varchar(255) default \'\',\n
`variation_text` VARCHAR(255),\n
`sub_variation_text` VARCHAR(255),\n
KEY `uid` (`uid`),\n
PRIMARY KEY (`uid`, `order_id`),\n
KEY `quantity` (`quantity`),\n
KEY `section_uid` (`section_uid`),\n
KEY `mirror_section_uid` (`mirror_section_uid`),\n
......
......@@ -101,7 +101,7 @@ CREATE TABLE `item` (\n
`aggregate_uid` BIGINT UNSIGNED default \'0\',\n
`variation_text` VARCHAR(255),\n
`simulation_state` VARCHAR(255) default \'\',\n
KEY `uid` (`uid`),\n
PRIMARY KEY (`uid`, `aggregate_uid`),\n
KEY `section_uid` (`section_uid`),\n
KEY `resource_uid` (`resource_uid`),\n
KEY `variation_text` (`variation_text`),\n
......@@ -157,7 +157,7 @@ CREATE TABLE `item` (\n
`aggregate_uid` BIGINT UNSIGNED default \'0\',\n
`variation_text` VARCHAR(255),\n
`simulation_state` VARCHAR(255) default \'\',\n
KEY `uid` (`uid`),\n
PRIMARY KEY (`uid`, `aggregate_uid`),\n
KEY `section_uid` (`section_uid`),\n
KEY `resource_uid` (`resource_uid`),\n
KEY `variation_text` (`variation_text`),\n
......
......@@ -100,7 +100,7 @@ CREATE TABLE `predicate_category` (\n
`category_uid` BIGINT UNSIGNED default \'0\',\n
`base_category_uid` BIGINT UNSIGNED default \'0\',\n
`category_strict_membership` tinyint(1) default \'0\',\n
KEY `uid` (`uid`),\n
PRIMARY KEY `uid` (`uid`, `category_uid`, `base_category_uid`, `category_strict_membership`),\n
KEY `category_strict_membership` (`category_strict_membership`),\n
KEY `Membership` (`category_uid`,`base_category_uid`),\n
KEY `FuzzyMembership` (`category_uid`)\n
......@@ -148,7 +148,7 @@ CREATE TABLE `predicate_category` (\n
`category_uid` BIGINT UNSIGNED default \'0\',\n
`base_category_uid` BIGINT UNSIGNED default \'0\',\n
`category_strict_membership` tinyint(1) default \'0\',\n
KEY `uid` (`uid`),\n
PRIMARY KEY `uid` (`uid`, `category_uid`, `base_category_uid`, `category_strict_membership`),\n
KEY `category_strict_membership` (`category_strict_membership`),\n
KEY `Membership` (`category_uid`,`base_category_uid`),\n
KEY `FuzzyMembership` (`category_uid`)\n
......
......@@ -97,6 +97,7 @@
#\n
CREATE TABLE `stock` (\n
`uid` BIGINT UNSIGNED NOT NULL,\n
`order_id` TINYINT UNSIGNED NOT NULL,\n
`node_uid` BIGINT UNSIGNED,\n
`section_uid` BIGINT UNSIGNED,\n
`payment_uid` BIGINT UNSIGNED,\n
......@@ -113,7 +114,7 @@ CREATE TABLE `stock` (\n
`simulation_state` varchar(255) default \'\',\n
`variation_text` VARCHAR(255),\n
`sub_variation_text` VARCHAR(255),\n
KEY `uid` (`uid`),\n
PRIMARY KEY (`uid`, `order_id`),\n
KEY `quantity` (`quantity`),\n
KEY `section_uid` (`section_uid`),\n
KEY `mirror_section_uid` (`mirror_section_uid`),\n
......@@ -168,6 +169,7 @@ CREATE TABLE `stock` (\n
#\n
CREATE TABLE `stock` (\n
`uid` BIGINT UNSIGNED NOT NULL,\n
`order_id` TINYINT UNSIGNED NOT NULL,\n
`node_uid` BIGINT UNSIGNED,\n
`section_uid` BIGINT UNSIGNED,\n
`payment_uid` BIGINT UNSIGNED,\n
......@@ -184,7 +186,7 @@ CREATE TABLE `stock` (\n
`simulation_state` varchar(255) default \'\',\n
`variation_text` VARCHAR(255),\n
`sub_variation_text` VARCHAR(255),\n
KEY `uid` (`uid`),\n
PRIMARY KEY (`uid`, `order_id`),\n
KEY `quantity` (`quantity`),\n
KEY `section_uid` (`section_uid`),\n
KEY `mirror_section_uid` (`mirror_section_uid`),\n
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment