Ticket #78 (closed enhancement: fixed)

Opened 10 months ago

Last modified 10 months ago

Add DBLayer method for adding and dropping new fields

Reported by: Rickard Assigned to: Rickard
Priority: normal Milestone: 1.3
Component: general Version: 1.2.*
Severity: normal Keywords:
Cc:

Description

Extensions will frequently want to add new fields to the database tables. Doing this cross-DBMS today is kind of clunky. A new method in the database class should solve this. Maybe something like:

function add_field($table_name, $field_name, $field_type, $allow_null, $default_value, $after_field = null)

The method could then translate certain field types into ones that are supported. For example, if the method would get called with $field_type set to TINYINT(1), it would get translated into SMALLINT for PostgreSQL. The $after_field parameter should be ignored for all but MySQL.

On top of this, a simple drop_field($table_name, $field_name) should be implemented.

Change History

10/22/07 19:21:27 changed by Rickard

  • status changed from new to closed.
  • resolution set to fixed.

Fixed in [1072].