alter table phonetype add column created timestamp with time zone;
alter table phonetype alter column created set default CURRENT_TIMESTAMP;
update phonetype set created = now() where created is null;
alter table phonetype alter column created set not null;

alter table phonetype add column lastupdate timestamp with time zone;
alter table phonetype alter column lastupdate set default CURRENT_TIMESTAMP;
update phonetype set lastupdate = now() where lastupdate is null;
alter table phonetype alter column lastupdate set not null;

DROP INDEX phone_pairedwith_index;
CREATE INDEX phone_pairedwith_index on phone (pairedwith);
