Create self documenting database upgrade scripts

Description

Database conversion scripts applied to CTools databases should be self documenting. This will greatly aid in determining the current status of a database. That is particularly important for the development instances as they may change frequently and may change greatly when a database has been restored.

A single new table would be required containing 3 columns: sequence number, time / date stamp, text. A SQL insert statement would added to each conversion script to add a row to the table when the conversion started and when it ended. No UI is required. Trivial ad-hoc sql queries can be used to list the information when it is required.

Environment

None

Test Plan

None

Activity

David Haines January 21, 2013 at 5:46 AM

Sample Oracle SQL to create and update table.

CREATE TABLE DB_CONVERSIONS (
id number NOT NULL,
datetime timestamp NOT NULL,
description varchar2(4000) NOT NULL
);

CREATE SEQUENCE DB_CONVERSIONS_ID_SEQ;

– Example sql to insert row.
INSERT INTO DB_CONVERSIONS (id,datetime,description)
VALUES (DB_CONVERSIONS_ID_SEQ.nextval,CURRENT_TIMESTAMP,
'HOWDY');

Fixed

Details

Assignee

Reporter

Conversion Script Required

Yes

Components

Affects versions

Priority

Created December 10, 2012 at 10:18 AM
Updated February 4, 2013 at 8:02 AM
Resolved January 23, 2013 at 10:18 AM

Flag notifications