USE billing;

ALTER TABLE invoice_template MODIFY is_active boolean not null default 0;

ALTER TABLE `invoice_template`
  ADD UNIQUE INDEX `invoice_template_reseller_active_UNIQUE` (`reseller_id`,`is_active`);