BEGIN;

alter table phonetype add column textprotocol varchar(12);
update phonetype set textprotocol = 'none' where textprotocol IS NULL;
alter table phonetype alter column textprotocol set NOT NULL;
alter table phonetype alter column textprotocol set default 'none';
alter table phonetype add constraint phonetype_textprotocol_check CHECK (textprotocol IN ('none','clarity'));

-- Generic Clarity GSM phone
INSERT INTO phonetype (id, cmsid, name, profile, lines, fkeys, extringtone, textprotocol)
  VALUES (240, 1, 'Generic Clarity GSM', 2, 1, 0, 'no', 'clarity');

COMMIT;

