Commit ca4cd04a authored by Yoshinori Okuji's avatar Yoshinori Okuji

Table optimization. This removes several columns, in particular

from catalog and movement. So it might be necessary to write
related keys.


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@3695 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 08c9a9cd
...@@ -4,6 +4,8 @@ connection_id:erp5_sql_connection ...@@ -4,6 +4,8 @@ connection_id:erp5_sql_connection
max_rows:1 max_rows:1
max_cache:0 max_cache:0
cache_time:0 cache_time:0
class_name:
class_file:
</dtml-comment> </dtml-comment>
<params>count:int <params>count:int
thread_id thread_id
......
...@@ -4,16 +4,18 @@ connection_id:erp5_sql_connection ...@@ -4,16 +4,18 @@ connection_id:erp5_sql_connection
max_rows:0 max_rows:0
max_cache:0 max_cache:0
cache_time:0 cache_time:0
class_name:
class_file:
</dtml-comment> </dtml-comment>
<params>count:int <params>count:int
instance_id</params> instance_id</params>
INSERT INTO INSERT INTO
catalog (id, path, CreationDate) catalog (id, path)
VALUES VALUES
<dtml-in "_.range(count - 1)"> <dtml-in "_.range(count - 1)">
( <dtml-sqlvar instance_id type="string"> , 'reserved', NOW() ) , ( <dtml-sqlvar instance_id type="string"> , 'reserved' ) ,
</dtml-in> </dtml-in>
( <dtml-sqlvar instance_id type="string"> , 'reserved', NOW() ); ( <dtml-sqlvar instance_id type="string"> , 'reserved' );
<dtml-var "'\0'"> <dtml-var "'\0'">
......
...@@ -4,9 +4,11 @@ connection_id:erp5_sql_connection ...@@ -4,9 +4,11 @@ connection_id:erp5_sql_connection
max_rows:0 max_rows:0
max_cache:0 max_cache:0
cache_time:0 cache_time:0
class_name:
class_file:
</dtml-comment> </dtml-comment>
<params>uid:int</params> <params>uid:int</params>
INSERT INTO INSERT INTO
catalog (uid, id, path, CreationDate) catalog (uid, id, path)
VALUES VALUES
( <dtml-sqlvar uid type="int">, 'dummy', 'reserved', NOW() ) ( <dtml-sqlvar uid type="int">, 'dummy', 'reserved' )
...@@ -6,47 +6,39 @@ ...@@ -6,47 +6,39 @@
<property id="sql_catalog_reserve_uid" type="str">z_reserve_uid</property> <property id="sql_catalog_reserve_uid" type="str">z_reserve_uid</property>
<property id="sql_catalog_object" type="tuple"> <property id="sql_catalog_object" type="tuple">
<item type="str">z_catalog_category</item> <item type="str">z_catalog_category</item>
<item type="str">z_catalog_compatibility</item>
<item type="str">z_catalog_item</item> <item type="str">z_catalog_item</item>
<item type="str">z_catalog_movement</item> <item type="str">z_catalog_movement</item>
<item type="str">z_catalog_predicate</item> <item type="str">z_catalog_predicate</item>
<item type="str">z_catalog_predicate_category</item> <item type="str">z_catalog_predicate_category</item>
<item type="str">z_catalog_roles_and_users</item> <item type="str">z_catalog_roles_and_users</item>
<item type="str">z_catalog_stock</item> <item type="str">z_catalog_stock</item>
<item type="str">z_catalog_subject</item>
<item type="str">z_update_delivery</item> <item type="str">z_update_delivery</item>
<item type="str">z_update_object</item> <item type="str">z_update_object</item>
</property> </property>
<property id="sql_uncatalog_object" type="tuple"> <property id="sql_uncatalog_object" type="tuple">
<item type="str">z0_uncatalog_category</item> <item type="str">z0_uncatalog_category</item>
<item type="str">z0_uncatalog_compatibility</item>
<item type="str">z0_uncatalog_item</item> <item type="str">z0_uncatalog_item</item>
<item type="str">z0_uncatalog_movement</item> <item type="str">z0_uncatalog_movement</item>
<item type="str">z0_uncatalog_predicate</item> <item type="str">z0_uncatalog_predicate</item>
<item type="str">z0_uncatalog_predicate_category</item> <item type="str">z0_uncatalog_predicate_category</item>
<item type="str">z0_uncatalog_stock</item> <item type="str">z0_uncatalog_stock</item>
<item type="str">z0_uncatalog_subject</item>
<item type="str">z_uncatalog_delivery</item> <item type="str">z_uncatalog_delivery</item>
<item type="str">z_uncatalog_object</item> <item type="str">z_uncatalog_object</item>
</property> </property>
<property id="sql_update_object" type="tuple"> <property id="sql_update_object" type="tuple">
<item type="str">z0_uncatalog_category</item> <item type="str">z0_uncatalog_category</item>
<item type="str">z0_uncatalog_compatibility</item>
<item type="str">z0_uncatalog_item</item> <item type="str">z0_uncatalog_item</item>
<item type="str">z0_uncatalog_movement</item> <item type="str">z0_uncatalog_movement</item>
<item type="str">z0_uncatalog_predicate</item> <item type="str">z0_uncatalog_predicate</item>
<item type="str">z0_uncatalog_predicate_category</item> <item type="str">z0_uncatalog_predicate_category</item>
<item type="str">z0_uncatalog_stock</item> <item type="str">z0_uncatalog_stock</item>
<item type="str">z0_uncatalog_subject</item>
<item type="str">z_catalog_category</item> <item type="str">z_catalog_category</item>
<item type="str">z_catalog_compatibility</item>
<item type="str">z_catalog_item</item> <item type="str">z_catalog_item</item>
<item type="str">z_catalog_movement</item> <item type="str">z_catalog_movement</item>
<item type="str">z_catalog_predicate</item> <item type="str">z_catalog_predicate</item>
<item type="str">z_catalog_predicate_category</item> <item type="str">z_catalog_predicate_category</item>
<item type="str">z_catalog_roles_and_users</item> <item type="str">z_catalog_roles_and_users</item>
<item type="str">z_catalog_stock</item> <item type="str">z_catalog_stock</item>
<item type="str">z_catalog_subject</item>
<item type="str">z_update_delivery</item> <item type="str">z_update_delivery</item>
<item type="str">z_update_object</item> <item type="str">z_update_object</item>
</property> </property>
...@@ -77,14 +69,16 @@ ...@@ -77,14 +69,16 @@
<item type="str">z_create_subject</item> <item type="str">z_create_subject</item>
</property> </property>
<property id="sql_catalog_object_list" type="tuple"> <property id="sql_catalog_object_list" type="tuple">
<item type="str">z_catalog_category_list</item> <item type="str">z_catalog_delivery_list</item>
<item type="str">z_catalog_compatibility_list</item>
<item type="str">z_catalog_item_list</item> <item type="str">z_catalog_item_list</item>
<item type="str">z_catalog_movement_category_list</item>
<item type="str">z_catalog_movement_list</item> <item type="str">z_catalog_movement_list</item>
<item type="str">z_catalog_non_movement_category_list</item>
<item type="str">z_catalog_object_list</item> <item type="str">z_catalog_object_list</item>
<item type="str">z_catalog_predicate_category_list</item>
<item type="str">z_catalog_predicate_list</item>
<item type="str">z_catalog_roles_and_users_list</item> <item type="str">z_catalog_roles_and_users_list</item>
<item type="str">z_catalog_stock_list</item> <item type="str">z_catalog_stock_list</item>
<item type="str">z_catalog_subject_list</item>
</property> </property>
<property id="sql_record_catalog_object" type="str">z_record_catalog_object</property> <property id="sql_record_catalog_object" type="str">z_record_catalog_object</property>
<property id="sql_record_uncatalog_object" type="str">z_record_uncatalog_object</property> <property id="sql_record_uncatalog_object" type="str">z_record_uncatalog_object</property>
...@@ -94,7 +88,6 @@ ...@@ -94,7 +88,6 @@
<property id="sql_search_tables" type="tuple"> <property id="sql_search_tables" type="tuple">
<item type="str">catalog</item> <item type="str">catalog</item>
<item type="str">category</item> <item type="str">category</item>
<item type="str">compatibility</item>
<item type="str">delivery</item> <item type="str">delivery</item>
<item type="str">movement</item> <item type="str">movement</item>
<item type="str">predicate</item> <item type="str">predicate</item>
...@@ -120,8 +113,6 @@ ...@@ -120,8 +113,6 @@
<item type="str">title</item> <item type="str">title</item>
</property> </property>
<property id="sql_catalog_full_text_search_keys" type="tuple"> <property id="sql_catalog_full_text_search_keys" type="tuple">
<item type="str">SearchableText</item>
<item type="str">compatibility.SearchableText</item>
</property> </property>
<property id="sql_catalog_request_keys" type="tuple"> <property id="sql_catalog_request_keys" type="tuple">
</property> </property>
...@@ -140,5 +131,14 @@ ...@@ -140,5 +131,14 @@
<item type="str">stock_mirrorSectionCategory | category/category_uid/z_related_mirror_section_uid_from_stock</item> <item type="str">stock_mirrorSectionCategory | category/category_uid/z_related_mirror_section_uid_from_stock</item>
<item type="str">variationCategory | category/category_uid/z_related_uid</item> <item type="str">variationCategory | category/category_uid/z_related_uid</item>
<item type="str">predicate_uid | predicate/uid/z_related_predicate</item> <item type="str">predicate_uid | predicate/uid/z_related_predicate</item>
<item type="str">base_category_id | category,catalog/id/z_related_base_category_id</item>
</property> </property>
<filter id="z_catalog_movement_category_list" expression="python: isMovement" />
<filter id="z_catalog_item_list" expression="python: isMovement" />
<filter id="z_catalog_predicate_category_list" expression="python: isPredicate" />
<filter id="z_catalog_movement_list" expression="python: isMovement" />
<filter id="z_catalog_predicate_list" expression="python: isPredicate" />
<filter id="z_catalog_stock_list" expression="python: isMovement" />
<filter id="z_catalog_delivery_list" expression="python: isDelivery" />
<filter id="z_catalog_non_movement_category_list" expression="python: not isMovement" />
</SQLCatalogData> </SQLCatalogData>
...@@ -5,7 +5,7 @@ max_rows:1000 ...@@ -5,7 +5,7 @@ max_rows:1000
max_cache:100 max_cache:100
cache_time:0 cache_time:0
class_name: class_name:
class_ class_file:
</dtml-comment> </dtml-comment>
<params></params> <params></params>
DROP TABLE delivery DROP TABLE delivery
...@@ -5,7 +5,7 @@ max_rows:1000 ...@@ -5,7 +5,7 @@ max_rows:1000
max_cache:100 max_cache:100
cache_time:0 cache_time:0
class_name: class_name:
class_ class_file:
</dtml-comment> </dtml-comment>
<params></params> <params></params>
DROP TABLE item DROP TABLE item
...@@ -5,7 +5,7 @@ max_rows:1000 ...@@ -5,7 +5,7 @@ max_rows:1000
max_cache:100 max_cache:100
cache_time:0 cache_time:0
class_name: class_name:
class_ class_file:
</dtml-comment> </dtml-comment>
<params>uid</params> <params>uid</params>
DELETE FROM item WHERE <dtml-sqltest uid op=eq type=int> DELETE FROM item WHERE <dtml-sqltest uid op=eq type=int>
...@@ -11,6 +11,16 @@ class_file: ...@@ -11,6 +11,16 @@ class_file:
isMovement isMovement
getCategoryList getCategoryList
getAcquiredCategoryList</params> getAcquiredCategoryList</params>
DELETE FROM
category
WHERE
<dtml-in uid>
uid=<dtml-sqlvar sequence-item type="int"><dtml-if sequence-end><dtml-else> OR </dtml-if>
</dtml-in>
;
<dtml-var "'\0'">
INSERT INTO category VALUES INSERT INTO category VALUES
<dtml-in prefix="loop" expr="_.range(_.len(uid))"> <dtml-in prefix="loop" expr="_.range(_.len(uid))">
<dtml-if sequence-start><dtml-else>,</dtml-if> <dtml-if sequence-start><dtml-else>,</dtml-if>
......
...@@ -12,6 +12,7 @@ Creator ...@@ -12,6 +12,7 @@ Creator
Date Date
PrincipiaSearchSource PrincipiaSearchSource
SearchableText SearchableText
CreationDate
EffectiveDate EffectiveDate
ExpiresDate ExpiresDate
ModificationDate ModificationDate
...@@ -32,6 +33,7 @@ INSERT INTO compatibility VALUES ( ...@@ -32,6 +33,7 @@ INSERT INTO compatibility VALUES (
<dtml-sqlvar Date type="datetime" optional>, <dtml-sqlvar Date type="datetime" optional>,
<dtml-sqlvar PrincipiaSearchSource type="string" optional>, <dtml-sqlvar PrincipiaSearchSource type="string" optional>,
<dtml-sqlvar SearchableText type="string" optional>, <dtml-sqlvar SearchableText type="string" optional>,
<dtml-sqlvar CreationDate type="datetime" optional>,
<dtml-sqlvar EffectiveDate type="datetime" optional>, <dtml-sqlvar EffectiveDate type="datetime" optional>,
<dtml-sqlvar ExpiresDate type="datetime" optional>, <dtml-sqlvar ExpiresDate type="datetime" optional>,
<dtml-sqlvar ModificationDate type="datetime" optional>, <dtml-sqlvar ModificationDate type="datetime" optional>,
......
...@@ -12,6 +12,7 @@ Creator ...@@ -12,6 +12,7 @@ Creator
Date Date
PrincipiaSearchSource PrincipiaSearchSource
SearchableText SearchableText
CreationDate
EffectiveDate EffectiveDate
ExpiresDate ExpiresDate
ModificationDate ModificationDate
...@@ -26,6 +27,16 @@ modified ...@@ -26,6 +27,16 @@ modified
review_state review_state
summary summary
</params> </params>
DELETE FROM
compatibility
WHERE
<dtml-in uid>
uid=<dtml-sqlvar sequence-item type="int"><dtml-if sequence-end><dtml-else> OR </dtml-if>
</dtml-in>
;
<dtml-var "'\0'">
INSERT INTO INSERT INTO
compatibility compatibility
VALUES VALUES
...@@ -36,6 +47,7 @@ VALUES ...@@ -36,6 +47,7 @@ VALUES
<dtml-sqlvar expr="Date[loop_item]" type="datetime" optional>, <dtml-sqlvar expr="Date[loop_item]" type="datetime" optional>,
<dtml-sqlvar expr="PrincipiaSearchSource[loop_item]" type="string" optional>, <dtml-sqlvar expr="PrincipiaSearchSource[loop_item]" type="string" optional>,
<dtml-sqlvar expr="SearchableText[loop_item]" type="string" optional>, <dtml-sqlvar expr="SearchableText[loop_item]" type="string" optional>,
<dtml-sqlvar expr="CreationDate[loop_item]" type="datetime" optional>,
<dtml-sqlvar expr="EffectiveDate[loop_item]" type="datetime" optional>, <dtml-sqlvar expr="EffectiveDate[loop_item]" type="datetime" optional>,
<dtml-sqlvar expr="ExpiresDate[loop_item]" type="datetime" optional>, <dtml-sqlvar expr="ExpiresDate[loop_item]" type="datetime" optional>,
<dtml-sqlvar expr="ModificationDate[loop_item]" type="datetime" optional>, <dtml-sqlvar expr="ModificationDate[loop_item]" type="datetime" optional>,
......
<dtml-comment>
title:
connection_id:erp5_sql_connection
max_rows:1000
max_cache:100
cache_time:0
class_name:
class_file:
</dtml-comment>
<params>isDelivery
uid
getSourceUid
getDestinationUid
getSourceSectionUid
getDestinationSectionUid
getResourceUid
getStartDate
getStartDateRangeMin
getStartDateRangeMax
getStopDate
getStopDateRangeMin
getStopDateRangeMax</params>
DELETE FROM
delivery
WHERE
<dtml-in uid>
uid=<dtml-sqlvar sequence-item type="int"><dtml-if sequence-end><dtml-else> OR </dtml-if>
</dtml-in>
;
<dtml-var "'\0'">
<dtml-let delivery_list="[]">
<dtml-in prefix="loop" expr="_.range(_.len(uid))">
<dtml-if "isDelivery[loop_item]">
<dtml-call expr="delivery_list.append(loop_item)">
</dtml-if>
</dtml-in>
<dtml-if expr="_.len(delivery_list) > 0">
INSERT INTO
delivery
VALUES
<dtml-in prefix="loop" expr="delivery_list">
(
<dtml-sqlvar expr="uid[loop_item]" type="int">,
<dtml-sqlvar getSourceUid[loop_item] type="int" optional>,
<dtml-sqlvar getDestinationUid[loop_item] type="int" optional>,
<dtml-sqlvar getSourceSectionUid[loop_item] type="int" optional>,
<dtml-sqlvar getDestinationSectionUid[loop_item] type="int" optional>,
<dtml-sqlvar getResourceUid[loop_item] type="int" optional>,
<dtml-sqlvar getStartDate[loop_item] type="datetime" optional>,
<dtml-sqlvar getStartDateRangeMin[loop_item] type="datetime" optional>,
<dtml-sqlvar getStartDateRangeMax[loop_item] type="datetime" optional>,
<dtml-sqlvar getStopDate[loop_item] type="datetime" optional>,
<dtml-sqlvar getStopDateRangeMin[loop_item] type="datetime" optional>,
<dtml-sqlvar getStopDateRangeMax[loop_item] type="datetime" optional>
)
<dtml-if sequence-end><dtml-else>,</dtml-if>
</dtml-in>
</dtml-if>
</dtml-let>
...@@ -5,7 +5,7 @@ max_rows:1000 ...@@ -5,7 +5,7 @@ max_rows:1000
max_cache:100 max_cache:100
cache_time:0 cache_time:0
class_name: class_name:
class_ class_file:
</dtml-comment> </dtml-comment>
<params>isMovement <params>isMovement
uid uid
......
...@@ -5,7 +5,7 @@ max_rows:1000 ...@@ -5,7 +5,7 @@ max_rows:1000
max_cache:100 max_cache:100
cache_time:0 cache_time:0
class_name: class_name:
class_ class_file:
</dtml-comment> </dtml-comment>
<params>isMovement <params>isMovement
uid uid
...@@ -15,13 +15,23 @@ getDestinationSectionUid ...@@ -15,13 +15,23 @@ getDestinationSectionUid
getResourceUid getResourceUid
getVariationText getVariationText
getAggregateUidList</params> getAggregateUidList</params>
DELETE FROM
item
WHERE
<dtml-in uid>
uid=<dtml-sqlvar sequence-item type="int"><dtml-if sequence-end><dtml-else> OR </dtml-if>
</dtml-in>
;
<dtml-var "'\0'">
<dtml-let movement_list="[]"> <dtml-let movement_list="[]">
<dtml-in prefix="loop" expr="_.range(_.len(uid))"> <dtml-in prefix="loop" expr="_.range(_.len(uid))">
<dtml-if "isMovement[loop_item]"> <dtml-if "isMovement[loop_item]">
<dtml-call expr="movement_list.append(loop_item)"> <dtml-call expr="movement_list.append(loop_item)">
</dtml-if> </dtml-if>
</dtml-in> </dtml-in>
<dtml-if expr="len(movement_list) > 0"> <dtml-if expr="_.len(movement_list) > 0">
INSERT INTO INSERT INTO
item item
VALUES VALUES
...@@ -34,7 +44,7 @@ VALUES ...@@ -34,7 +44,7 @@ VALUES
<dtml-sqlvar expr="getDestinationSectionUid[loop_item]" type="int" optional>, <dtml-sqlvar expr="getDestinationSectionUid[loop_item]" type="int" optional>,
<dtml-sqlvar expr="getResourceUid[loop_item]" type="int" optional>, <dtml-sqlvar expr="getResourceUid[loop_item]" type="int" optional>,
<dtml-sqlvar sequence-item type="int" optional>, <dtml-sqlvar sequence-item type="int" optional>,
<dtml-sqlvar expr="getVariationText[loop_item]" type="string" optional>, <dtml-sqlvar expr="getVariationText[loop_item]" type="string" optional>
) )
<dtml-if sequence-end><dtml-else>,</dtml-if></dtml-in></dtml-if> <dtml-if sequence-end><dtml-else>,</dtml-if></dtml-in></dtml-if>
<dtml-if sequence-end><dtml-else>,</dtml-if> <dtml-if sequence-end><dtml-else>,</dtml-if>
......
...@@ -5,7 +5,7 @@ max_rows:1000 ...@@ -5,7 +5,7 @@ max_rows:1000
max_cache:100 max_cache:100
cache_time:0 cache_time:0
class_name: class_name:
class_ class_file:
</dtml-comment> </dtml-comment>
<params>isMovement <params>isMovement
uid uid
...@@ -13,16 +13,10 @@ getExplanationUid ...@@ -13,16 +13,10 @@ getExplanationUid
getSourceUid getSourceUid
getDestinationUid getDestinationUid
getResourceUid getResourceUid
getNetConvertedQuantity getInventoriatedQuantity
getInventory
getStartDate getStartDate
getStopDate getStopDate
getNetConvertedTargetQuantity
getTargetStartDate
getTargetStopDate
getPrice getPrice
getTotalPrice
getTargetTotalPrice
isAccountable isAccountable
isOrderable isOrderable
isDeliverable isDeliverable
...@@ -35,16 +29,10 @@ INSERT INTO movement VALUES ( ...@@ -35,16 +29,10 @@ INSERT INTO movement VALUES (
<dtml-if getSourceUid><dtml-sqlvar getSourceUid type="int"><dtml-else>NULL</dtml-if>, <dtml-if getSourceUid><dtml-sqlvar getSourceUid type="int"><dtml-else>NULL</dtml-if>,
<dtml-if getDestinationUid ><dtml-sqlvar getDestinationUid type="int"><dtml-else>NULL</dtml-if>, <dtml-if getDestinationUid ><dtml-sqlvar getDestinationUid type="int"><dtml-else>NULL</dtml-if>,
<dtml-if getResourceUid><dtml-sqlvar getResourceUid type="int"><dtml-else>NULL</dtml-if>, <dtml-if getResourceUid><dtml-sqlvar getResourceUid type="int"><dtml-else>NULL</dtml-if>,
<dtml-if getNetConvertedQuantity><dtml-sqlvar getNetConvertedQuantity type="float"><dtml-else>NULL</dtml-if>, <dtml-if getInventoriatedQuantity><dtml-sqlvar getInventoriatedQuantity type="float"><dtml-else>NULL</dtml-if>,
<dtml-if getInventory><dtml-sqlvar getInventory type="float"><dtml-else>NULL</dtml-if>,
<dtml-if getStartDate><dtml-sqlvar getStartDate type="datetime"><dtml-else>NULL</dtml-if>, <dtml-if getStartDate><dtml-sqlvar getStartDate type="datetime"><dtml-else>NULL</dtml-if>,
<dtml-if getStopDate><dtml-sqlvar getStopDate type="datetime"><dtml-else>NULL</dtml-if>, <dtml-if getStopDate><dtml-sqlvar getStopDate type="datetime"><dtml-else>NULL</dtml-if>,
<dtml-if getNetConvertedTargetQuantity><dtml-sqlvar getNetConvertedTargetQuantity type="float"><dtml-else>NULL</dtml-if>,
<dtml-if getTargetStartDate><dtml-sqlvar getTargetStartDate type="datetime"><dtml-else>NULL</dtml-if>,
<dtml-if getTargetStopDate><dtml-sqlvar getTargetStopDate type="datetime"><dtml-else>NULL</dtml-if>,
<dtml-if getPrice><dtml-sqlvar getPrice type="float"><dtml-else>NULL</dtml-if>, <dtml-if getPrice><dtml-sqlvar getPrice type="float"><dtml-else>NULL</dtml-if>,
<dtml-if getTotalPrice><dtml-sqlvar getTotalPrice type="float"><dtml-else>NULL</dtml-if>,
<dtml-if getTargetTotalPrice><dtml-sqlvar getTargetTotalPrice type="float"><dtml-else>NULL</dtml-if>,
<dtml-if "isAccountable is not None"><dtml-sqlvar isAccountable type="int"><dtml-else>NULL</dtml-if>, <dtml-if "isAccountable is not None"><dtml-sqlvar isAccountable type="int"><dtml-else>NULL</dtml-if>,
<dtml-if "isOrderable is not None"><dtml-sqlvar isOrderable type="int"><dtml-else>NULL</dtml-if>, <dtml-if "isOrderable is not None"><dtml-sqlvar isOrderable type="int"><dtml-else>NULL</dtml-if>,
<dtml-if "isDeliverable is not None"><dtml-sqlvar isDeliverable type="int"><dtml-else>NULL</dtml-if>, <dtml-if "isDeliverable is not None"><dtml-sqlvar isDeliverable type="int"><dtml-else>NULL</dtml-if>,
......
<dtml-comment>
title:
connection_id:erp5_sql_connection
max_rows:1000
max_cache:100
cache_time:0
class_name:
class_file:
</dtml-comment>
<params>uid
isMovement
getCategoryList</params>
DELETE FROM
category
WHERE
<dtml-in uid>
uid=<dtml-sqlvar sequence-item type="int"><dtml-if sequence-end><dtml-else> OR </dtml-if>
</dtml-in>
;
<dtml-var "'\0'">
INSERT INTO category VALUES
<dtml-in prefix="loop" expr="_.range(_.len(uid))">
<dtml-if sequence-start><dtml-else>,</dtml-if>
<dtml-if expr="getCategoryList[loop_item]">
<dtml-let uid_list="portal_categories.getCategoryParentUidList(getCategoryList[loop_item])">
<dtml-if uid_list>
<dtml-in prefix="uid" expr="uid_list">
<dtml-if sequence-start><dtml-else>,</dtml-if>
(
<dtml-sqlvar expr="uid[loop_item]" type="int">,
<dtml-sqlvar expr="uid_item[0]" type="int">,
<dtml-sqlvar expr="uid_item[1]" type="int">,
<dtml-sqlvar expr="uid_item[2]" type="int">
)
</dtml-in>
<dtml-else>
(
<dtml-sqlvar expr="uid[loop_item]" type="int">,
NULL,
NULL,
1
)
</dtml-if>
</dtml-let>
<dtml-else>
(
<dtml-sqlvar expr="uid[loop_item]" type="int">,
NULL,
NULL,
1
)
</dtml-if>
</dtml-in>
...@@ -13,29 +13,32 @@ getExplanationUid ...@@ -13,29 +13,32 @@ getExplanationUid
getSourceUid getSourceUid
getDestinationUid getDestinationUid
getResourceUid getResourceUid
getNetConvertedQuantity getInventoriatedQuantity
getInventory getStartDate
getInventoriatedStartDate getStopDate
getInventoriatedStopDate
getNetConvertedTargetQuantity
getTargetStartDate
getTargetStopDate
getPrice getPrice
getTotalPrice
getTargetTotalPrice
hasCellContent
isAccountable isAccountable
isOrderable isOrderable
isDeliverable isDeliverable
isDivergent isDivergent
getVariationText</params> getVariationText</params>
DELETE FROM
movement
WHERE
<dtml-in uid>
uid=<dtml-sqlvar sequence-item type="int"><dtml-if sequence-end><dtml-else> OR </dtml-if>
</dtml-in>
;
<dtml-var "'\0'">
<dtml-let movement_list="[]"> <dtml-let movement_list="[]">
<dtml-in prefix="loop" expr="_.range(_.len(uid))"> <dtml-in prefix="loop" expr="_.range(_.len(uid))">
<dtml-if "isMovement[loop_item]"> <dtml-if "isMovement[loop_item]">
<dtml-call expr="movement_list.append(loop_item)"> <dtml-call expr="movement_list.append(loop_item)">
</dtml-if> </dtml-if>
</dtml-in> </dtml-in>
<dtml-if expr="len(movement_list) > 0"> <dtml-if expr="_.len(movement_list) > 0">
INSERT INTO INSERT INTO
movement movement
VALUES VALUES
...@@ -46,17 +49,10 @@ VALUES ...@@ -46,17 +49,10 @@ VALUES
<dtml-sqlvar expr="getSourceUid[loop_item]" type="int" optional>, <dtml-sqlvar expr="getSourceUid[loop_item]" type="int" optional>,
<dtml-sqlvar expr="getDestinationUid[loop_item]" type="int" optional>, <dtml-sqlvar expr="getDestinationUid[loop_item]" type="int" optional>,
<dtml-sqlvar expr="getResourceUid[loop_item]" type="int" optional>, <dtml-sqlvar expr="getResourceUid[loop_item]" type="int" optional>,
<dtml-sqlvar expr="getNetConvertedQuantity[loop_item]" type="float" optional>, <dtml-sqlvar expr="getInventoriatedQuantity[loop_item]" type="float" optional>,
<dtml-sqlvar expr="getInventory[loop_item]" type="float" optional>, <dtml-sqlvar expr="getStartDate[loop_item]" type="datetime" optional>,
<dtml-sqlvar expr="getInventoriatedStartDate[loop_item]" type="datetime" optional>, <dtml-sqlvar expr="getStopDate[loop_item]" type="datetime" optional>,
<dtml-sqlvar expr="getInventoriatedStopDate[loop_item]" type="datetime" optional>,
<dtml-sqlvar expr="getNetConvertedTargetQuantity[loop_item]" type="float" optional>,
<dtml-sqlvar expr="getTargetStartDate[loop_item]" type="datetime" optional>,
<dtml-sqlvar expr="getTargetStopDate[loop_item]" type="datetime" optional>,
<dtml-sqlvar expr="getPrice[loop_item]" type="float" optional>, <dtml-sqlvar expr="getPrice[loop_item]" type="float" optional>,
<dtml-sqlvar expr="getTotalPrice[loop_item]" type="float" optional>,
<dtml-sqlvar expr="getTargetTotalPrice[loop_item]" type="float" optional>,
<dtml-sqlvar expr="hasCellContent[loop_item]" type="int" optional>,
<dtml-sqlvar expr="isAccountable[loop_item]" type="int" optional>, <dtml-sqlvar expr="isAccountable[loop_item]" type="int" optional>,
<dtml-sqlvar expr="isOrderable[loop_item]" type="int" optional>, <dtml-sqlvar expr="isOrderable[loop_item]" type="int" optional>,
<dtml-sqlvar expr="isDeliverable[loop_item]" type="int" optional>, <dtml-sqlvar expr="isDeliverable[loop_item]" type="int" optional>,
......
<dtml-comment>
title:
connection_id:erp5_sql_connection
max_rows:1000
max_cache:100
cache_time:0
class_name:
class_file:
</dtml-comment>
<params>uid
getAcquiredCategoryList</params>
DELETE FROM
category
WHERE
<dtml-in uid>
uid=<dtml-sqlvar sequence-item type="int"><dtml-if sequence-end><dtml-else> OR </dtml-if>
</dtml-in>
;
<dtml-var "'\0'">
INSERT INTO category VALUES
<dtml-in prefix="loop" expr="_.range(_.len(uid))">
<dtml-if sequence-start><dtml-else>,</dtml-if>
<dtml-if expr="getAcquiredCategoryList[loop_item]">
<dtml-let uid_list="portal_categories.getCategoryParentUidList(getAcquiredCategoryList[loop_item])">
<dtml-if uid_list>
<dtml-in prefix="uid" expr="uid_list">
<dtml-if sequence-start><dtml-else>,</dtml-if>
(
<dtml-sqlvar expr="uid[loop_item]" type="int">,
<dtml-sqlvar expr="uid_item[0]" type="int">,
<dtml-sqlvar expr="uid_item[1]" type="int">,
<dtml-sqlvar expr="uid_item[2]" type="int">
)
</dtml-in>
<dtml-else>
(
<dtml-sqlvar expr="uid[loop_item]" type="int">,
NULL,
NULL,
1
)
</dtml-if>
</dtml-let>
<dtml-else>
(
<dtml-sqlvar expr="uid[loop_item]" type="int">,
NULL,
NULL,
1
)
</dtml-if>
</dtml-in>
...@@ -13,26 +13,16 @@ getPath ...@@ -13,26 +13,16 @@ getPath
getRelativeUrl getRelativeUrl
getParentUid getParentUid
id id
CreationDate
getDescription getDescription
getTitle getTitle
meta_type meta_type
getPortalType getPortalType
opportunity_state opportunity_state
getDefaultSourceReference getCorporateRegistrationCode
getDefaultDestinationReference
getDefaultSourceTitle
getDefaultDestinationTitle
getDefaultSourceSectionTitle
getDefaultDestinationSectionTitle
getDefaultCausalityId
getLocation
getEan13Code getEan13Code
simulation_state simulation_state
causality_state causality_state
discussion_state
invoice_state invoice_state
getOrderId
validation_state validation_state
payment_state payment_state
event_state event_state
...@@ -42,7 +32,18 @@ getSourceReference ...@@ -42,7 +32,18 @@ getSourceReference
getDestinationReference getDestinationReference
getStringIndex getStringIndex
getIntIndex getIntIndex
getFloatIndex</params> getFloatIndex
hasCellContent</params>
DELETE FROM
catalog
WHERE
<dtml-in uid>
uid=<dtml-sqlvar sequence-item type="int"><dtml-if sequence-end><dtml-else> OR </dtml-if>
</dtml-in>
;
<dtml-var "'\0'">
INSERT INTO INSERT INTO
catalog catalog
VALUES VALUES
...@@ -54,37 +55,27 @@ VALUES ...@@ -54,37 +55,27 @@ VALUES
<dtml-sqlvar expr="getRelativeUrl[loop_item]" type="string">, <dtml-sqlvar expr="getRelativeUrl[loop_item]" type="string">,
<dtml-sqlvar expr="getParentUid[loop_item]" type="int">, <dtml-sqlvar expr="getParentUid[loop_item]" type="int">,
<dtml-sqlvar expr="id[loop_item]" type="string" optional>, <dtml-sqlvar expr="id[loop_item]" type="string" optional>,
<dtml-sqlvar expr="CreationDate[loop_item]" type="datetime" optional>,
<dtml-sqlvar expr="getDescription[loop_item]" type="string" optional>, <dtml-sqlvar expr="getDescription[loop_item]" type="string" optional>,
<dtml-sqlvar expr="getTitle[loop_item]" type="string" optional>, <dtml-sqlvar expr="getTitle[loop_item]" type="string" optional>,
<dtml-sqlvar expr="meta_type[loop_item]" type="string" optional>, <dtml-sqlvar expr="meta_type[loop_item]" type="string" optional>,
<dtml-sqlvar expr="getPortalType[loop_item]" type="string" optional>, <dtml-sqlvar expr="getPortalType[loop_item]" type="string" optional>,
<dtml-sqlvar expr="opportunity_state[loop_item]" type="string" optional>, <dtml-sqlvar expr="opportunity_state[loop_item]" type="string" optional>,
<dtml-sqlvar expr="getDefaultSourceReference[loop_item]" type="string" optional>, <dtml-sqlvar expr="getCorporateRegistrationCode[loop_item]" type="string" optional>,
<dtml-sqlvar expr="getDefaultDestinationReference[loop_item]" type="string" optional>,
<dtml-sqlvar expr="getDefaultSourceTitle[loop_item]" type="string" optional>,
<dtml-sqlvar expr="getDefaultDestinationTitle[loop_item]" type="string" optional>,
<dtml-sqlvar expr="getDefaultSourceSectionTitle[loop_item]" type="string" optional>,
<dtml-sqlvar expr="getDefaultDestinationSectionTitle[loop_item]" type="string" optional>,
<dtml-sqlvar expr="getDefaultCausalityId[loop_item]" type="string" optional>,
<dtml-sqlvar expr="getLocation[loop_item]" type="string" optional>,
<dtml-sqlvar expr="getEan13Code[loop_item]" type="string" optional>, <dtml-sqlvar expr="getEan13Code[loop_item]" type="string" optional>,
<dtml-sqlvar expr="validation_state[loop_item]" type="string" optional>, <dtml-sqlvar expr="validation_state[loop_item]" type="string" optional>,
<dtml-sqlvar expr="simulation_state[loop_item]" type="string" optional>, <dtml-sqlvar expr="simulation_state[loop_item]" type="string" optional>,
<dtml-sqlvar expr="causality_state[loop_item]" type="string" optional>, <dtml-sqlvar expr="causality_state[loop_item]" type="string" optional>,
<dtml-sqlvar expr="discussion_state[loop_item]" type="string" optional>, <dtml-sqlvar expr="invoice_state[loop_item]" type="string" optional>,
<dtml-sqlvar expr="payment_state[loop_item]" type="string" optional>, <dtml-sqlvar expr="payment_state[loop_item]" type="string" optional>,
<dtml-sqlvar expr="event_state[loop_item]" type="string" optional>, <dtml-sqlvar expr="event_state[loop_item]" type="string" optional>,
<dtml-sqlvar expr="invoice_state[loop_item]" type="string" optional>,
<dtml-sqlvar expr="getOrderId[loop_item]" type="string" optional>,
<dtml-sqlvar expr="getReference[loop_item]" type="string" optional>, <dtml-sqlvar expr="getReference[loop_item]" type="string" optional>,
<dtml-sqlvar expr="getGroupingReference[loop_item]" type="string" optional>, <dtml-sqlvar expr="getGroupingReference[loop_item]" type="string" optional>,
<dtml-sqlvar expr="getSourceReference[loop_item]" type="string" optional>, <dtml-sqlvar expr="getSourceReference[loop_item]" type="string" optional>,
<dtml-sqlvar expr="getDestinationReference[loop_item]" type="string" optional>, <dtml-sqlvar expr="getDestinationReference[loop_item]" type="string" optional>,
<dtml-sqlvar expr="getStringIndex[loop_item]" type="string" optional>, <dtml-sqlvar expr="getStringIndex[loop_item]" type="string" optional>,
<dtml-sqlvar expr="getIntIndex[loop_item]" type="int" optional>, <dtml-sqlvar expr="getIntIndex[loop_item]" type="int" optional>,
<dtml-sqlvar expr="getFloatIndex[loop_item]" type="float" optional> <dtml-sqlvar expr="getFloatIndex[loop_item]" type="float" optional>,
<dtml-sqlvar expr="hasCellContent[loop_item]" type="int" optional>
) )
<dtml-if sequence-end><dtml-else>,</dtml-if> <dtml-if sequence-end><dtml-else>,</dtml-if>
</dtml-in> </dtml-in>
...@@ -8,25 +8,42 @@ class_name: ...@@ -8,25 +8,42 @@ class_name:
class_file: class_file:
</dtml-comment> </dtml-comment>
<params>uid <params>uid
getMembershipCriterionCategoryList predicate_property_dict
isPredicate</params> isPredicate</params>
INSERT INTO predicate_category VALUES DELETE FROM
<dtml-in prefix="loop" expr="_.range(_.len(uid))"> predicate_category
<dtml-if sequence-start><dtml-else>,</dtml-if> WHERE
<dtml-if isPredicate[loop_item]> <dtml-in uid>
<dtml-if getMembershipCriterionCategoryList[loop_item]> uid=<dtml-sqlvar sequence-item type="int"><dtml-if sequence-end><dtml-else> OR </dtml-if>
<dtml-let uid_list="portal_categories.getCategoryParentUidList(getMembershipCriterionCategoryList[loop_item])">
<dtml-if uid_list>
<dtml-in "uid_list">
(<dtml-sqlvar uid type="int">, <dtml-var "_['sequence-item'][0]" >, <dtml-var "_['sequence-item'][1]" >, <dtml-var "_['sequence-item'][2]" >)
<dtml-if sequence-end><dtml-else>,</dtml-if>
</dtml-in> </dtml-in>
<dtml-else> ;
(<dtml-sqlvar uid[loop_item] type="int">, NULL, NULL,1),
</dtml-if> <dtml-var "'\0'">
<dtml-let predicate_list="[]">
<dtml-in prefix="loop" expr="_.range(_.len(uid))">
<dtml-if "isPredicate[loop_item]">
<dtml-call expr="predicate_list.append(loop_item)">
</dtml-if>
</dtml-in>
<dtml-if expr="_.len(predicate_list) > 0">
INSERT INTO predicate_category VALUES
<dtml-in prefix="loop" expr="predicate_list">
<dtml-if sequence-start><dtml-else>,</dtml-if>
<dtml-if "predicate_property_dict[loop_item].has_key('membership_criterion_category_list')">
<dtml-let uid_list="portal_categories.getCategoryParentUidList(predicate_property_dict[loop_item]['membership_criterion_category_list'])">
<dtml-if uid_list>
<dtml-in "uid_list">
(<dtml-sqlvar expr="uid[loop_item]" type="int">, <dtml-var "_['sequence-item'][0]" >, <dtml-var "_['sequence-item'][1]" >, <dtml-var "_['sequence-item'][2]" >)
<dtml-if sequence-end><dtml-else>,</dtml-if>
</dtml-in>
<dtml-else>
(<dtml-sqlvar expr="uid[loop_item]" type="int">, NULL, NULL,1)
</dtml-if>
</dtml-let>
<dtml-else>
(<dtml-sqlvar expr="uid[loop_item]" type="int">, NULL, NULL,1)
</dtml-if>
</dtml-in>
</dtml-if>
</dtml-let> </dtml-let>
<dtml-else>
(<dtml-sqlvar uid[loop_item] type="int">, NULL, NULL,1),
</dtml-if>
</dtml-if>
</dtml-in>
...@@ -10,14 +10,35 @@ class_file: ...@@ -10,14 +10,35 @@ class_file:
<params>uid <params>uid
isPredicate isPredicate
predicate_property_dict</params> predicate_property_dict</params>
INSERT INTO predicate VALUES DELETE FROM
<dtml-in prefix="loop" expr="_.range(_.len(uid))"> predicate
<dtml-if sequence-start><dtml-else>,</dtml-if> WHERE
<dtml-if isPredicate[loop_item]>( <dtml-in uid>
<dtml-sqlvar uid[loop_item] type="int">, uid=<dtml-sqlvar sequence-item type="int"><dtml-if sequence-end><dtml-else> OR </dtml-if>
<dtml-if expr="predicate_property_dict[loop_item].has_key('quantity')"><dtml-sqlvar expr="predicate_property_dict[loop_item]['quantity']" type="float"><dtml-else>NULL</dtml-if>,
<dtml-if expr="predicate_property_dict[loop_item].has_key('quantity_min')"><dtml-sqlvar expr="predicate_property_dict[loop_item]['quantity_min']" type="float"><dtml-else>NULL</dtml-if>,
<dtml-if expr="predicate_property_dict[loop_item].has_key('quantity_max')"><dtml-sqlvar expr="predicate_property_dict[loop_item]['quantity_max']" type="float"><dtml-else>NULL</dtml-if>
)
</dtml-if>
</dtml-in> </dtml-in>
;
<dtml-var "'\0'">
<dtml-let predicate_list="[]">
<dtml-in prefix="loop" expr="_.range(_.len(uid))">
<dtml-if "isPredicate[loop_item]">
<dtml-call expr="predicate_list.append(loop_item)">
</dtml-if>
</dtml-in>
<dtml-if expr="_.len(predicate_list) > 0">
INSERT INTO predicate VALUES
<dtml-in prefix="loop" expr="predicate_list">
<dtml-if sequence-start><dtml-else>,</dtml-if>
(
<dtml-sqlvar expr="uid[loop_item]" type="int">,
<dtml-sqlvar expr="predicate_property_dict[loop_item].get('quantity', None)" type="float" optional>,
<dtml-sqlvar expr="predicate_property_dict[loop_item].get('quantity_range_min', None)" type="float" optional>,
<dtml-sqlvar expr="predicate_property_dict[loop_item].get('quantity_range_max', None)" type="float" optional>,
<dtml-sqlvar expr="predicate_property_dict[loop_item].get('start_date', None)" type="datetime" optional>,
<dtml-sqlvar expr="predicate_property_dict[loop_item].get('start_date_range_min', None)" type="datetime" optional>,
<dtml-sqlvar expr="predicate_property_dict[loop_item].get('start_date_range_max', None)" type="datetime" optional>
)
</dtml-in>
</dtml-if>
</dtml-let>
...@@ -17,7 +17,7 @@ optimised_roles_and_users</params> ...@@ -17,7 +17,7 @@ optimised_roles_and_users</params>
</dtml-in> </dtml-in>
</dtml-if> </dtml-if>
</dtml-in> </dtml-in>
<dtml-if expr="len(row_list) > 0"> <dtml-if expr="row_list">
INSERT INTO INSERT INTO
roles_and_users roles_and_users
VALUES VALUES
......
<dtml-comment> <dtml-comment>
title: title:
connection_id:erp5_sql_connection connection_id:erp5_sql_connection
max_rows:1000 max_rows:0
max_cache:100 max_cache:100
cache_time:0 cache_time:0
class_name: class_name:
...@@ -28,6 +28,16 @@ getStopDate ...@@ -28,6 +28,16 @@ getStopDate
isAccountable isAccountable
getPortalType getPortalType
getVariationText</params> getVariationText</params>
DELETE FROM
stock
WHERE
<dtml-in uid>
uid=<dtml-sqlvar sequence-item type="int"><dtml-if sequence-end><dtml-else> OR </dtml-if>
</dtml-in>
;
<dtml-var "'\0'">
<dtml-let row_list="[]"> <dtml-let row_list="[]">
<dtml-in prefix="loop" expr="_.range(_.len(uid))"> <dtml-in prefix="loop" expr="_.range(_.len(uid))">
<dtml-if "isMovement[loop_item]"> <dtml-if "isMovement[loop_item]">
...@@ -42,7 +52,7 @@ getVariationText</params> ...@@ -42,7 +52,7 @@ getVariationText</params>
</dtml-if> </dtml-if>
</dtml-in> </dtml-in>
<dtml-if "len(row_list) > 0"> <dtml-if "row_list">
INSERT INTO INSERT INTO
stock stock
VALUES VALUES
...@@ -57,11 +67,11 @@ VALUES ...@@ -57,11 +67,11 @@ VALUES
<dtml-sqlvar expr="row_item[6]" type="int" optional>, <dtml-sqlvar expr="row_item[6]" type="int" optional>,
<dtml-sqlvar expr="row_item[7]" type="int">, <dtml-sqlvar expr="row_item[7]" type="int">,
<dtml-sqlvar expr="row_item[8]" type="float" optional>, <dtml-sqlvar expr="row_item[8]" type="float" optional>,
<dtml-sqlvar expr="row_item[9]" type="datetime" optional> <dtml-sqlvar expr="row_item[9]" type="datetime" optional>,
<dtml-sqlvar expr="row_item[10]" type="float" optional> <dtml-sqlvar expr="row_item[10]" type="float" optional>,
<dtml-sqlvar expr="row_item[11]" type="int" optional> <dtml-sqlvar expr="row_item[11]" type="int" optional>,
<dtml-sqlvar expr="row_item[12]" type="string" optional> <dtml-sqlvar expr="row_item[12]" type="string" optional>,
<dtml-sqlvar expr="row_item[13]" type="string" optional> <dtml-sqlvar expr="row_item[13]" type="string" optional>,
<dtml-sqlvar expr="row_item[14]" type="string" optional> <dtml-sqlvar expr="row_item[14]" type="string" optional>
) )
<dtml-if sequence-end><dtml-else>,</dtml-if> <dtml-if sequence-end><dtml-else>,</dtml-if>
......
...@@ -9,6 +9,16 @@ class_file: ...@@ -9,6 +9,16 @@ class_file:
</dtml-comment> </dtml-comment>
<params>Subject <params>Subject
uid</params> uid</params>
DELETE FROM
subject
WHERE
<dtml-in uid>
uid=<dtml-sqlvar sequence-item type="int"><dtml-if sequence-end><dtml-else> OR </dtml-if>
</dtml-in>
;
<dtml-var "'\0'">
INSERT INTO subject VALUES INSERT INTO subject VALUES
<dtml-in prefix="loop" expr="_.range(_.len(uid))"> <dtml-in prefix="loop" expr="_.range(_.len(uid))">
<dtml-if sequence-start><dtml-else>,</dtml-if> <dtml-if sequence-start><dtml-else>,</dtml-if>
......
...@@ -19,37 +19,26 @@ CREATE TABLE `catalog` ( ...@@ -19,37 +19,26 @@ CREATE TABLE `catalog` (
`relative_url` varchar(255) NOT NULL default '', `relative_url` varchar(255) NOT NULL default '',
`parent_uid` BIGINT UNSIGNED default '0', `parent_uid` BIGINT UNSIGNED default '0',
`id` varchar(255) default '', `id` varchar(255) default '',
`CreationDate` datetime default '0000-00-00 00:00:00',
`description` text, `description` text,
`title` varchar(255) default '', `title` varchar(255) default '',
`meta_type` varchar(255) default '', `meta_type` varchar(255) default '',
`portal_type` varchar(255) default '', `portal_type` varchar(255) default '',
`opportunity_state` varchar(255) default '', `opportunity_state` varchar(255) default '',
`default_source_reference` varchar(255) default '', `corporate_registration_code` varchar(255),
`default_destination_reference` varchar(255) default '',
`default_source_title` varchar(255) default '',
`default_destination_title` varchar(255) default '',
`default_source_section_title` varchar(255) default '',
`default_destination_section_title` varchar(255) default '',
`default_causality_id` varchar(255) default '',
`location` varchar(255),
`ean13_code` varchar(255), `ean13_code` varchar(255),
`validation_state` varchar(255) default '', `validation_state` varchar(255) default '',
`simulation_state` varchar(255) default '', `simulation_state` varchar(255) default '',
`causality_state` varchar(255) default '', `causality_state` varchar(255) default '',
`discussion_state` varchar(255) default '',
`invoice_state` varchar(255) default '', `invoice_state` varchar(255) default '',
`payment_state` varchar(255) default '', `payment_state` varchar(255) default '',
`event_state` varchar(255) default '', `event_state` varchar(255) default '',
`order_id` varchar(255) default '',
`reference` varchar(255) default '', `reference` varchar(255) default '',
`grouping_reference` varchar(30) default '',
`source_reference` varchar(255) default '', `source_reference` varchar(255) default '',
`destination_reference` varchar(255) default '', `destination_reference` varchar(255) default '',
`string_index` varchar(255), `string_index` varchar(255),
`int_index` INT, `int_index` INT,
`float_index` real, `float_index` real,
`has_cell_content` tinyint(1) default '0', `has_cell_content` bool,
PRIMARY KEY (`uid`), PRIMARY KEY (`uid`),
KEY `security_uid` (`security_uid`), KEY `security_uid` (`security_uid`),
KEY `Parent` (`parent_uid`), KEY `Parent` (`parent_uid`),
...@@ -62,9 +51,7 @@ CREATE TABLE `catalog` ( ...@@ -62,9 +51,7 @@ CREATE TABLE `catalog` (
KEY `validation_state` (`validation_state`), KEY `validation_state` (`validation_state`),
KEY `simulation_state` (`simulation_state`), KEY `simulation_state` (`simulation_state`),
KEY `causality_state` (`causality_state`), KEY `causality_state` (`causality_state`),
KEY `discussion_state` (`discussion_state`),
KEY `invoice_state` (`invoice_state`), KEY `invoice_state` (`invoice_state`),
KEY `order_id` (`order_id`),
KEY `payment_state` (`payment_state`), KEY `payment_state` (`payment_state`),
KEY `event_state` (`event_state`) KEY `event_state` (`event_state`)
) TYPE=InnoDB; ) TYPE=InnoDB;
...@@ -18,6 +18,7 @@ CREATE TABLE `compatibility` ( ...@@ -18,6 +18,7 @@ CREATE TABLE `compatibility` (
`Date` datetime default '0000-00-00 00:00:00', `Date` datetime default '0000-00-00 00:00:00',
`PrincipiaSearchSource` text, `PrincipiaSearchSource` text,
`SearchableText` text, `SearchableText` text,
`CreationDate` datetime default '0000-00-00 00:00:00',
`EffectiveDate` datetime default '0000-00-00 00:00:00', `EffectiveDate` datetime default '0000-00-00 00:00:00',
`ExpiresDate` datetime default '0000-00-00 00:00:00', `ExpiresDate` datetime default '0000-00-00 00:00:00',
`ModificationDate` datetime default '0000-00-00 00:00:00', `ModificationDate` datetime default '0000-00-00 00:00:00',
......
...@@ -5,7 +5,7 @@ max_rows:1000 ...@@ -5,7 +5,7 @@ max_rows:1000
max_cache:100 max_cache:100
cache_time:0 cache_time:0
class_name: class_name:
class_ class_file:
</dtml-comment> </dtml-comment>
<params></params> <params></params>
CREATE TABLE `delivery` ( CREATE TABLE `delivery` (
...@@ -16,7 +16,11 @@ CREATE TABLE `delivery` ( ...@@ -16,7 +16,11 @@ CREATE TABLE `delivery` (
`destination_section_uid` BIGINT UNSIGNED default '0', `destination_section_uid` BIGINT UNSIGNED default '0',
`resource_uid` BIGINT UNSIGNED default '0', `resource_uid` BIGINT UNSIGNED default '0',
`start_date` datetime default NULL, `start_date` datetime default NULL,
`start_date_range_min` datetime default NULL,
`start_date_range_max` datetime default NULL,
`stop_date` datetime default NULL, `stop_date` datetime default NULL,
`stop_date_range_min` datetime default NULL,
`stop_date_range_max` datetime default NULL,
KEY `uid` (`uid`), KEY `uid` (`uid`),
KEY `source_uid` (`source_uid`), KEY `source_uid` (`source_uid`),
KEY `destination_uid` (`destination_uid`), KEY `destination_uid` (`destination_uid`),
......
...@@ -5,7 +5,7 @@ max_rows:1000 ...@@ -5,7 +5,7 @@ max_rows:1000
max_cache:100 max_cache:100
cache_time:0 cache_time:0
class_name: class_name:
class_ class_file:
</dtml-comment> </dtml-comment>
<params></params> <params></params>
# Host: # Host:
......
...@@ -19,15 +19,9 @@ CREATE TABLE `movement` ( ...@@ -19,15 +19,9 @@ CREATE TABLE `movement` (
`destination_uid` BIGINT UNSIGNED default '0', `destination_uid` BIGINT UNSIGNED default '0',
`resource_uid` BIGINT UNSIGNED default '0', `resource_uid` BIGINT UNSIGNED default '0',
`quantity` real default '0.0', `quantity` real default '0.0',
`inventory` real default '0.0',
`start_date` datetime, `start_date` datetime,
`stop_date` datetime, `stop_date` datetime,
`target_quantity` real default '0.0',
`target_start_date` datetime,
`target_stop_date` datetime,
`price` real, `price` real,
`total_price` real,
`target_total_price` real,
`is_accountable` bool, `is_accountable` bool,
`is_orderable` bool, `is_orderable` bool,
`is_deliverable` bool, `is_deliverable` bool,
......
...@@ -13,7 +13,7 @@ CREATE TABLE predicate ( ...@@ -13,7 +13,7 @@ CREATE TABLE predicate (
`quantity` real , `quantity` real ,
`quantity_range_min` real , `quantity_range_min` real ,
`quantity_range_max` real , `quantity_range_max` real ,
`start_date` datetime , `start_date` datetime,
`start_date_range_min` datetime , `start_date_range_min` datetime ,
`start_date_range_max` datetime , `start_date_range_max` datetime ,
KEY `uid` (`uid`) KEY `uid` (`uid`)
......
<dtml-comment>
title:
connection_id:erp5_sql_connection
max_rows:1000
max_cache:100
cache_time:0
class_name:
class_file:
</dtml-comment>
<params>table_0
table_1</params>
<dtml-var table_1>.portal_type = 'Base Category' AND
<dtml-var table_1>.uid = <dtml-var table_0>.base_category_uid AND
<dtml-var table_0>.category_strict_membership = 1 AND
<dtml-var table_0>.uid = catalog.uid
\ No newline at end of file
...@@ -40,4 +40,6 @@ ORDER BY ...@@ -40,4 +40,6 @@ ORDER BY
</dtml-if> </dtml-if>
<dtml-if limit_expression> <dtml-if limit_expression>
LIMIT <dtml-var "limit_expression"> LIMIT <dtml-var "limit_expression">
<dtml-else>
LIMIT 1000
</dtml-if> </dtml-if>
...@@ -5,7 +5,7 @@ max_rows:1000 ...@@ -5,7 +5,7 @@ max_rows:1000
max_cache:100 max_cache:100
cache_time:0 cache_time:0
class_name: class_name:
class_ class_file:
</dtml-comment> </dtml-comment>
<params>uid</params> <params>uid</params>
DELETE FROM delivery WHERE <dtml-sqltest uid op=eq type=int> DELETE FROM delivery WHERE <dtml-sqltest uid op=eq type=int>
...@@ -5,7 +5,7 @@ max_rows:1000 ...@@ -5,7 +5,7 @@ max_rows:1000
max_cache:100 max_cache:100
cache_time:0 cache_time:0
class_name: class_name:
class_ class_file:
</dtml-comment> </dtml-comment>
<params>isDelivery <params>isDelivery
uid uid
...@@ -15,7 +15,11 @@ getSourceSectionUid ...@@ -15,7 +15,11 @@ getSourceSectionUid
getDestinationSectionUid getDestinationSectionUid
getResourceUid getResourceUid
getStartDate getStartDate
getStartDateRangeMin
getStartDateRangeMax
getStopDate getStopDate
getStopDateRangeMin
getStopDateRangeMax
insert_line</params> insert_line</params>
<dtml-if insert_line> <dtml-if insert_line>
INSERT INTO delivery(uid) VALUES (<dtml-sqlvar uid type="int">); INSERT INTO delivery(uid) VALUES (<dtml-sqlvar uid type="int">);
...@@ -32,6 +36,10 @@ UPDATE delivery SET ...@@ -32,6 +36,10 @@ UPDATE delivery SET
destination_section_uid=<dtml-sqlvar getDestinationSectionUid type="int" optional>, destination_section_uid=<dtml-sqlvar getDestinationSectionUid type="int" optional>,
resource_uid=<dtml-sqlvar getResourceUid type="int" optional>, resource_uid=<dtml-sqlvar getResourceUid type="int" optional>,
start_date=<dtml-sqlvar getStartDate type="datetime" optional>, start_date=<dtml-sqlvar getStartDate type="datetime" optional>,
stop_date=<dtml-sqlvar getStopDate type="datetime" optional> start_date_range_min=<dtml-sqlvar getStartDateRangeMin type="datetime" optional>,
start_date_range_max=<dtml-sqlvar getStartDateRangeMax type="datetime" optional>,
stop_date=<dtml-sqlvar getStopDate type="datetime" optional>,
stop_date_range_min=<dtml-sqlvar getStopDateRangeMin type="datetime" optional>,
stop_date_range_max=<dtml-sqlvar getStopDateRangeMax type="datetime" optional>
WHERE <dtml-sqltest uid op=eq type=int> WHERE <dtml-sqltest uid op=eq type=int>
</dtml-if> </dtml-if>
...@@ -13,26 +13,15 @@ getPath ...@@ -13,26 +13,15 @@ getPath
getRelativeUrl getRelativeUrl
getParentUid getParentUid
id id
CreationDate
getDescription getDescription
getTitle getTitle
meta_type meta_type
getPortalType getPortalType
opportunity_state opportunity_state
getDefaultSourceReference
getDefaultDestinationReference
getDefaultSourceTitle
getDefaultDestinationTitle
getDefaultSourceSectionTitle
getDefaultDestinationSectionTitle
getDefaultCausalityId
getLocation
getEan13Code getEan13Code
getSimulationState getSimulationState
causality_state causality_state
discussion_state
invoice_state invoice_state
getOrderId
validation_state validation_state
payment_state payment_state
event_state event_state
...@@ -43,6 +32,7 @@ getDestinationReference ...@@ -43,6 +32,7 @@ getDestinationReference
getStringIndex getStringIndex
getIntIndex getIntIndex
getFloatIndex getFloatIndex
getCorporateRegistrationCode
insert_catalog_line insert_catalog_line
hasCellContent</params> hasCellContent</params>
<dtml-if insert_catalog_line> <dtml-if insert_catalog_line>
...@@ -57,29 +47,19 @@ UPDATE catalog SET uid=<dtml-sqlvar uid type="int">, ...@@ -57,29 +47,19 @@ UPDATE catalog SET uid=<dtml-sqlvar uid type="int">,
relative_url=<dtml-sqlvar getRelativeUrl type="string">, relative_url=<dtml-sqlvar getRelativeUrl type="string">,
parent_uid=<dtml-sqlvar getParentUid type="int" optional>, parent_uid=<dtml-sqlvar getParentUid type="int" optional>,
id=<dtml-sqlvar id type="string" optional>, id=<dtml-sqlvar id type="string" optional>,
CreationDate=<dtml-sqlvar CreationDate type="datetime" optional>,
description=<dtml-sqlvar getDescription type="string" optional>, description=<dtml-sqlvar getDescription type="string" optional>,
title=<dtml-sqlvar getTitle type="string" optional>, title=<dtml-sqlvar getTitle type="string" optional>,
meta_type=<dtml-sqlvar meta_type type="string" optional>, meta_type=<dtml-sqlvar meta_type type="string" optional>,
portal_type=<dtml-sqlvar getPortalType type="string" optional>, portal_type=<dtml-sqlvar getPortalType type="string" optional>,
opportunity_state=<dtml-sqlvar opportunity_state type="string" optional>, opportunity_state=<dtml-sqlvar opportunity_state type="string" optional>,
default_source_reference=<dtml-sqlvar getDefaultSourceReference type="string" optional>, corporate_registration_code=<dtml-sqlvar getCorporateRegistrationCode type="string" optional>,
default_destination_reference=<dtml-sqlvar getDefaultDestinationReference type="string" optional>,
default_source_title=<dtml-sqlvar getDefaultSourceTitle type="string" optional>,
default_destination_title=<dtml-sqlvar getDefaultDestinationTitle type="string" optional>,
default_source_section_title=<dtml-sqlvar getDefaultSourceSectionTitle type="string" optional>,
default_destination_section_title=<dtml-sqlvar getDefaultDestinationSectionTitle type="string" optional>,
default_causality_id=<dtml-sqlvar getDefaultCausalityId type="string" optional>,
location=<dtml-sqlvar getLocation type="string" optional>,
ean13_code=<dtml-sqlvar getEan13Code type="string" optional>, ean13_code=<dtml-sqlvar getEan13Code type="string" optional>,
validation_state=<dtml-sqlvar validation_state type="string" optional>, validation_state=<dtml-sqlvar validation_state type="string" optional>,
simulation_state=<dtml-sqlvar getSimulationState type="string" optional>, simulation_state=<dtml-sqlvar getSimulationState type="string" optional>,
causality_state=<dtml-sqlvar causality_state type="string" optional>, causality_state=<dtml-sqlvar causality_state type="string" optional>,
discussion_state=<dtml-sqlvar discussion_state type="string" optional>,
payment_state=<dtml-sqlvar payment_state type="string" optional>, payment_state=<dtml-sqlvar payment_state type="string" optional>,
event_state=<dtml-sqlvar event_state type="string" optional>, event_state=<dtml-sqlvar event_state type="string" optional>,
invoice_state=<dtml-sqlvar invoice_state type="string" optional>, invoice_state=<dtml-sqlvar invoice_state type="string" optional>,
order_id=<dtml-sqlvar getOrderId type="string" optional>,
reference=<dtml-sqlvar getReference type="string" optional>, reference=<dtml-sqlvar getReference type="string" optional>,
grouping_reference=<dtml-sqlvar getGroupingReference type="string" optional>, grouping_reference=<dtml-sqlvar getGroupingReference type="string" optional>,
source_reference=<dtml-sqlvar getSourceReference type="string" optional>, source_reference=<dtml-sqlvar getSourceReference type="string" optional>,
......
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