--liquibase formatted sql
--changeset system:create enhancement table

--comment: apr_appreciation
CREATE TABLE `apr_appreciation` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `created` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `createdBy` varchar(30) DEFAULT NULL,
  `version` int NOT NULL DEFAULT '0',
  `modified` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `modifiedBy` varchar(30) DEFAULT NULL,
  `deleted` tinyint(1) NOT NULL DEFAULT '0',

  `sbuIds` json NOT NULL,
  `receiptDate` datetime NOT NULL,
  `description` TEXT NOT NULL,
  `clientDepartment` VARCHAR(255) DEFAULT NULL,
  `clientOrganization` VARCHAR(255) DEFAULT NULL,
  `clientFullname` VARCHAR(50) DEFAULT NULL,
  `clientPost` VARCHAR(50) DEFAULT NULL,
  `venue` VARCHAR(255) DEFAULT NULL,
  `clientReplyDate` datetime DEFAULT NULL,
  `staffReplyDate` datetime DEFAULT NULL,
  `noOfStaff` int(11) DEFAULT NULL,
  `lnReceiptDate` datetime NOT NULL,
  `aprCategoryId` int(11) NOT NULL ,
  `remarks` VARCHAR(255) DEFAULT NULL,
  `importDate` datetime DEFAULT NULL,
  
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

--comment: apr_sbu
CREATE TABLE `apr_sbu` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `created` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `createdBy` varchar(30) DEFAULT NULL,
  `version` int NOT NULL DEFAULT '0',
  `modified` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `modifiedBy` varchar(30) DEFAULT NULL,
  `deleted` tinyint(1) NOT NULL DEFAULT '0',

  `name` VARCHAR(255) NOT NULL,
  
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

--comment: apr_client_department
CREATE TABLE `apr_client_department` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `created` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `createdBy` varchar(30) DEFAULT NULL,
  `version` int NOT NULL DEFAULT '0',
  `modified` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `modifiedBy` varchar(30) DEFAULT NULL,
  `deleted` tinyint(1) NOT NULL DEFAULT '0',

  `name` VARCHAR(255) NOT NULL,
  
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

--comment: apr_category
CREATE TABLE `apr_category` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `created` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `createdBy` varchar(30) DEFAULT NULL,
  `version` int NOT NULL DEFAULT '0',
  `modified` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `modifiedBy` varchar(30) DEFAULT NULL,
  `deleted` tinyint(1) NOT NULL DEFAULT '0',

  `name` VARCHAR(255) NOT NULL,
  
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
