How To Change The Size of a Column
Languages: |
TemplateThis sub-template doesn't display properly when not included. Please see Template:Languages for the complete version. UsageThis template is designed to simplify Template:Languages, by allowing a simpler syntax for adding new languages. Each language is included by calling this template with the following parameters:
This template should not be used anywhere except in the Languages template. </noinclude> | Translate this article... |
Objective
The objective of this article is to show you how to change the size of a column inside the database. It enables the user to have a certain amount of flexibility within his/her database.
Recommended articles
Before reading this guide, it is necessary to have a proper understanding of Openbravo's Modularity concept and how to create and package a module,
as we take the knowledge from these articles as a given in this guide.
In case you are working with configuration scripts or templates on a regular basis, the following link to an article might be of interest to you, since it describes how to create a configuration script.
Execution Steps
In Openbravo you are able to change the size of a column. To achieve this you must follow the following steps:
- Create a template and set its status as "In Development".
- Modify the column size within the database with the "ALTER TABLE" SQL command.
- IMPORTANT: The new value must be greater than the old one.<source lang = "sql">Postgres: ALTER TABLE <table_name> ALTER COLUMN <column_name> type <type>(<new_size>) Oracle: ALTER TABLE <table_name> MODIFY <column_name> <type>(<new_size>) </source>
- Update the new column size in the Application Dictionary. For this, we go to the "Tables and Columns" window, find the column definition and specify the new size there
- Export the database: "ant export.database" (with this you are exporting the template definitions)
- Export the configuration script: "ant export.config.script" (with this you are exporting the core changes into the template)
- Check the generated configuration script and verify that the change regarding the new column size appears in the first lines.