How to exclude Database Physical Objects From Model

From InfiniteERP Wiki
Revision as of 20:50, 14 October 2018 by Wikiadmin (talk | contribs) (Created page with "==Objective== Openbravo keeps track of the database physical objects (such as tables, views, functions or triggers) through an utility called [DBSourceManager]. This utility i...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Objective

Openbravo keeps track of the database physical objects (such as tables, views, functions or triggers) through an utility called [DBSourceManager]. This utility is able to export all the database model object definitions to XML files, which are stored in the src-db/database/model folder (both in Core and in modules).

This tool is designed to work in a multiplatform environment, both supporting Oracle and PostgreSQL. This means that sometimes if specific syntax or features of a particular Database Management System are used, the tool might not support them.

In these cases, a possible approach is to create these specific objects using a Module Script (you can find more about them here), and then exclude them from the database physical model of Openbravo.

Excluding objects in modules

Objects are excluded through a file called excludeFilter.xml. This file should be located inside the src-db/database/model/ folder of the module (if it doesn't exist, you will need to create it), and it follows a very simple XML format. Here is an example:


<source lang="xml"><?xml version="1.0"?>

 <vector>
   <excludedTable name="TEST_TABLE"/>
   <excludedView name="TEST_VIEW"/>
   <excludedFunction name="TEST_FUNCTION"/>
   <excludedTrigger name="TEST_TRIGGER"/>
 </vector>

</source>

This file will exclude the table TEST_TABLE, the view TEST_VIEW, the function TEST_FUNCTION, and the trigger TEST_TRIGGER from the model, and therefore they will be neither exported nor removed, nor modified in any way during the normal database management tasks (update.database and export.database).