postgresql
7.1
insert into ec_custom_product_fields
(field_identifier, field_name, default_value, column_type, last_modified, last_modifying_user, modified_ip_address)
values
(:field_identifier, :field_name, :default_value, :column_type, current_timestamp, :user_id, :peeraddr)
alter table ec_custom_product_field_values
add column $field_identifier $column_type $end_of_alter
alter table ec_custom_p_field_values_audit
add column $field_identifier $column_type
-- PostgreSQL 7.1.3 can't drop columns and will fail on this query --
alter table ec_custom_product_field_values
drop column $field_identifier
drop function ec_custom_p_f_values_audit_tr ()
drop trigger ec_custom_p_f_values_audit_tr on ec_custom_product_field_values
create trigger ec_custom_p_f_values_audit_tr
before update or delete on ec_custom_product_field_values
for each row execute procedure ec_custom_p_f_values_audit_tr ()