Skip to main content

Notice: this Wiki will be going read only early in 2024 and edits will no longer be possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.

Jump to: navigation, search

Difference between revisions of "Aperi Database R2 Extensibility"

(How do I change the database schema)
Line 1: Line 1:
 
 
=== How do I coordinate a database schema change? ===
 
=== How do I coordinate a database schema change? ===
  
Line 26: Line 25:
  
 
It may be necessary to regenerate a dependent view if a table definition is changed.
 
It may be necessary to regenerate a dependent view if a table definition is changed.
 +
 +
=== Which schema file should I change? ===
 +
 +
First, we need an explanation of the Aperi schema versioning method.
 +
 +
=== How do I change the schema file? ===
 +
 +
Below is an example of a sample table definition to be added to a schema file.
 +
 +
<nowiki>
 +
###############################################################
 +
## TABLE: T_RES_SWITCH_ATTRIBUTE_SNAPSHOT
 +
## Entity representing historical snapshot for T_RES_SWITCH_ATTRIBUTE
 +
## FOREIGN KEYS: SWITCH_WWN
 +
###############################################################
 +
CREATE TABLE T_RES_SWITCH_ATTRIBUTE_SNAPSHOT
 +
(SWITCH_WWN          CHAR(16) NOT NULL, # WWN of switch
 +
VERSION            VARCHAR(255),      # Version of the switch
 +
DETECTABLE          {1},              # Switch detectable or not
 +
OPERATIONAL_STATUS  {0}) {121}        # Switch operational status
 +
;
 +
 +
ALTER TABLE T_RES_SWITCH_ATTRIBUTE_SNAPSHOT ADD PRIMARY KEY (SWITCH_WWN)
 +
;
 +
 +
# ALTER TABLE T_RES_SWITCH_ATTRIBUTE_SNAPSHOT ADD FOREIGN KEY
 +
# FK_SWITCH_WWN FOREIGN KEY (SWITCH_WWN) REFERENCES T_RES_SWITCH
 +
# (SWITCH_WWN)
 +
</nowiki>

Revision as of 18:06, 22 January 2007

How do I coordinate a database schema change?

This section assumes that the person is familiar with the Database Component Design (MS Word).

When some database change is needed, the team member responsible for the work item (referred as the requester) will analyze the application requirements, draft the database changes on schema, helper, mapper, detectability with the help of the entire design team The requester should analyze the impact of the changes on the whole of Aperi.

The change request will be reviewed and approved by a deadline, by the design team (led by the database team lead). If needed, the committee may request consultation from special expertise area.

The requester will be responsible for the implementation of the change, and negotiate any resource issue if there is a need. The requester should test the new schema file(s) by using them to replace the corresponding files in a proper version of Aperi. The requester should make an overall build with all the changes to ensure nothing breaks. The requester will send out a note to the aperi-dev mailing list highlighting the change.

How do I analyze the impact of a database schema change?

The following changes usually have no impact on Aperi:

  1. Add a table, view, column, index (including primary key). An important thing to note is that a new name might conflict with existing ones (See the Helper documentation in the Database Component Design (MS Word) for more details). For example, the table name T_TSM_SERVER conflicts with T_RES_SERVER.

The following changes might have an impact on Aperi:

  1. Delete a table, view, column
  2. Change the data type of a column
  3. Change the encoding of data
  4. Delete a primary key, index
  5. Change table data population

Changes to the data type of a column are not recommended.

It may be necessary to regenerate a dependent view if a table definition is changed.

Which schema file should I change?

First, we need an explanation of the Aperi schema versioning method.

How do I change the schema file?

Below is an example of a sample table definition to be added to a schema file.

############################################################### ## TABLE: T_RES_SWITCH_ATTRIBUTE_SNAPSHOT ## Entity representing historical snapshot for T_RES_SWITCH_ATTRIBUTE ## FOREIGN KEYS: SWITCH_WWN ############################################################### CREATE TABLE T_RES_SWITCH_ATTRIBUTE_SNAPSHOT (SWITCH_WWN CHAR(16) NOT NULL, # WWN of switch VERSION VARCHAR(255), # Version of the switch DETECTABLE {1}, # Switch detectable or not OPERATIONAL_STATUS {0}) {121} # Switch operational status ; ALTER TABLE T_RES_SWITCH_ATTRIBUTE_SNAPSHOT ADD PRIMARY KEY (SWITCH_WWN) ; # ALTER TABLE T_RES_SWITCH_ATTRIBUTE_SNAPSHOT ADD FOREIGN KEY # FK_SWITCH_WWN FOREIGN KEY (SWITCH_WWN) REFERENCES T_RES_SWITCH # (SWITCH_WWN)

Back to the top