#
# From 0.80-dev11+ - Convert user_address_attribute table to include a 
# lookup_attribute_val column.
#
#
# Item Attribute functionality
# 
RENAME TABLE user_address_attribute TO user_address_attribute_old;

#
# User address attribute
#
DROP TABLE IF EXISTS user_address_attribute;
CREATE TABLE user_address_attribute (
  ua_sequence_number	integer(10) unsigned NOT NULL,
  s_attribute_type		varchar(10) NOT NULL,
  order_no				tinyint(3) unsigned NOT NULL,
  lookup_attribute_val 	varchar(50) NOT NULL,
  attribute_val			text,
  update_on				timestamp(14) NOT NULL,
  PRIMARY KEY ( ua_sequence_number, s_attribute_type, order_no, lookup_attribute_val )
) TYPE=MyISAM COMMENT='User address attribute';

ALTER TABLE user_address ADD update_on timestamp(14) NOT NULL AFTER end_dt;