CREATE TABLE `tblapad_options` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `type` varchar(191) NULL DEFAULT NULL,
  `name` varchar(191) NOT NULL,
  `value` longtext NOT NULL,
  `autoload` tinyint(1) NOT NULL DEFAULT '1'
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

ALTER TABLE `tblapad_options`
  ADD PRIMARY KEY (`id`),
  ADD KEY `name` (`name`);

ALTER TABLE `tblapad_options`
  MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=1;


CREATE TABLE `tblitems_groups_static` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `name` varchar(50) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
ALTER TABLE `tblitems_groups_static` ADD PRIMARY KEY (`id`);
ALTER TABLE `tblitems_groups_static` MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT;


INSERT INTO `tblitems_groups_static` (`id`, `name`) VALUES (NULL, 'Services'), (NULL, 'Products')


INSERT INTO `tbloptions_static` (`id`, `name`, `value`, `autoload`) VALUES ( NULL, 'expense_prefix', 'EX-', '1'), ( NULL, 'next_expense_number', '1', '0'), ( NULL, 'expense_format', '1', '1'), ( NULL, 'allow_staff_view_expense_assigned', '1', '1');

ALTER TABLE `tblexpenses` ADD `number` BIGINT(20) NULL DEFAULT NULL AFTER `tax_two_amount`, ADD `prefix` VARCHAR(50) NULL DEFAULT NULL AFTER `number`, ADD `number_format` BIGINT(20) NOT NULL DEFAULT '0' AFTER `prefix`;