# $Id: update_tables-0.8.4.mysql,v 1.8.2.1 2001/05/28 21:42:02 bettina Exp $

#################################################
# update : 03/03/2001 from 0.8.3.1 to 0.8.4pre1 #
#################################################

alter table p_projects rename phpgw_p_projects;
alter table phpgw_p_projects change column date start_date int(11) DEFAULT '0' NOT NULL;
alter table phpgw_p_projects drop column access;
alter table phpgw_p_projects modify column title varchar(255) NOT NULL;
alter table phpgw_p_projects modify column num varchar(20) NOT NULL;

CREATE INDEX phpgw_p_projects_key ON phpgw_p_projects(id,num);

alter table p_activities rename phpgw_p_activities;
alter table phpgw_p_activities modify column descr varchar(255) NOT NULL;
alter table phpgw_p_activities modify column num varchar(20) NOT NULL;
CREATE INDEX phpgw_p_activities_key ON phpgw_p_activities(id,num);

alter table p_projectactivities rename phpgw_p_projectactivities;
alter table p_hours rename phpgw_p_hours;
alter table p_projectmembers rename phpgw_p_projectmembers;

alter table p_invoice rename phpgw_p_invoice;
alter table phpgw_p_invoice modify column num varchar(20) NOT NULL;
CREATE INDEX phpgw_p_invoice_key ON phpgw_p_invoice(id,num); 

alter table p_invoicepos rename phpgw_p_invoicepos;
alter table p_delivery rename phpgw_p_delivery;
alter table phpgw_p_delivery modify column num varchar(20) NOT NULL;
CREATE INDEX phpgw_p_delivery_key ON phpgw_p_delivery(id,num);

alter table p_deliverypos rename phpgw_p_deliverypos;

###################################################
#             03/05/2001 0.8.4pre2                #
###################################################

alter table phpgw_p_hours drop column date;
alter table phpgw_p_hours add column start_date int(11) DEFAULT '0' NOT NULL after entry_date;

###################################################
#             03/09/2001 0.8.4pre3                # 
###################################################

alter table phpgw_p_hours add column hours_descr varchar(255) NOT NULL after end_date;

###################################################
#             03/09/2001 0.8.4pre4                # 
###################################################

alter table phpgw_p_projects add column access varchar(7) after owner;
alter table phpgw_p_projects add column category int(9) DEFAULT '0' NOT NULL after access;
alter table phpgw_p_projects modify column status enum('active','nonactive','archive') NOT NULL;

###################################################
#		04/10/2001 0.8.4pre5		  #
###################################################

alter table phpgw_p_projectmembers add column type char(2);
