--- add-type-to-clients

ALTER TABLE clients ADD type VARCHAR;

UPDATE clients SET type='integrated';

ALTER TABLE clients ALTER COLUMN type SET NOT NULL;

ALTER TABLE clients ALTER COLUMN integration_id DROP NOT NULL;

ALTER TABLE clients ADD telegram_id BIGINT;

CREATE UNIQUE INDEX clients_telegram_id_uniq ON clients(telegram_id) WHERE telegram_id IS NOT NULL;


