-- 
-- MosP - Mind Open Source Project    http://www.mosp.jp/
-- Copyright (C) MIND Co., Ltd.       http://www.e-mind.co.jp/
-- 
-- This program is free software; you can redistribute it and/or
-- modify it under the terms of the GNU General Public License
-- as published by the Free Software Foundation; either version 2
-- of the License, or (at your option) any later version.
-- 
-- This program is distributed in the hope that it will be useful,
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-- GNU General Public License for more details.
-- 
-- You should have received a copy of the GNU General Public License
-- along with this program; if not, write to the Free Software
-- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
-- 
ALTER TABLE `CT_WORKFLOW` CHANGE `WORKFLOW` `WORKFLOW` BIGINT UNSIGNED ZEROFILL NOT NULL DEFAULT '0' COMMENT 'ワークフロー番号';
ALTER TABLE `CT_HOLIDAYREQUEST` CHANGE `WORKFLOW` `WORKFLOW` BIGINT UNSIGNED ZEROFILL NOT NULL DEFAULT '0' COMMENT 'ワークフロー番号';

ALTER TABLE  `M_SYUKKINBO` CHANGE `SHANKYUKB` `SHANKYUKB` VARCHAR(1) CHARACTER SET cp932 COLLATE cp932_japanese_ci NOT NULL DEFAULT '' COMMENT '出勤半休区分';
ALTER TABLE  `M_SYUKKINBO` CHANGE `THANKYUKB` `THANKYUKB` VARCHAR(1) CHARACTER SET cp932 COLLATE cp932_japanese_ci NOT NULL DEFAULT '' COMMENT '退勤半休区分';

ALTER TABLE  `M_SCHEDULE` CHANGE `SHANKYUKB` `SHANKYUKB` VARCHAR(1) CHARACTER SET cp932 COLLATE cp932_japanese_ci NOT NULL DEFAULT '' COMMENT '出勤半休区分';
ALTER TABLE  `M_SCHEDULE` CHANGE `THANKYUKB` `THANKYUKB` VARCHAR(1) CHARACTER SET cp932 COLLATE cp932_japanese_ci NOT NULL DEFAULT '' COMMENT '退勤半休区分';

INSERT INTO `CM_CODE` VALUES
('JAPANESE', 'JC_MEIJI', '明治', 1, 0, '1971-01-01 00:00:00', '', '1971-01-01 00:00:00', ''),
('JAPANESE', 'JC_TAISH', '大正', 2, 0, '1971-01-01 00:00:00', '', '1971-01-01 00:00:00', ''),
('JAPANESE', 'JC_SHOUW', '昭和', 3, 0, '1971-01-01 00:00:00', '', '1971-01-01 00:00:00', ''),
('JAPANESE', 'JC_HEISE', '平成', 4, 0, '1971-01-01 00:00:00', '', '1971-01-01 00:00:00', '');

DELETE FROM `CM_CODE` WHERE `CM_CODE`.`T_ID` = 'BRACKET1' AND `CM_CODE`.`T_CODE` = '0';
DELETE FROM `CM_CODE` WHERE `CM_CODE`.`T_ID` = 'BRACKET1' AND `CM_CODE`.`T_CODE` = '1';

DELETE FROM `CM_CODE` WHERE `CM_CODE`.`T_ID` = 'BRACKET2' AND `CM_CODE`.`T_CODE` = '0';
DELETE FROM `CM_CODE` WHERE `CM_CODE`.`T_ID` = 'BRACKET2' AND `CM_CODE`.`T_CODE` = '1';

DELETE FROM `CM_CODE` WHERE `CM_CODE`.`T_ID` = 'BRACKET3' AND `CM_CODE`.`T_CODE` = '0';
DELETE FROM `CM_CODE` WHERE `CM_CODE`.`T_ID` = 'BRACKET3' AND `CM_CODE`.`T_CODE` = '1';
DELETE FROM `CM_CODE` WHERE `CM_CODE`.`T_ID` = 'BRACKET3' AND `CM_CODE`.`T_CODE` = '2';
--
-- Table structure for table `CM_AUTHORITY`
--

DROP TABLE IF EXISTS `CM_AUTHORITY`;
CREATE TABLE `CM_AUTHORITY` (
  `AUTHCODE` varchar(2) NOT NULL COMMENT '権限コード',
  `AUTHNAME` varchar(10) NOT NULL COMMENT '権限ネーム',
  `EMPLOYEE` varchar(10) NOT NULL COMMENT '従業員メニュー',
  `MANAGER` varchar(10) NOT NULL COMMENT 'マネージャーメニュー',
  `PAYROLL` varchar(10) NOT NULL COMMENT '給与メニュー',
  `HUMAN` varchar(10) NOT NULL COMMENT '人事メニュー',
  `INSURANCE` varchar(10) NOT NULL COMMENT '社会保険メニュー',
  `BONUS` varchar(10) NOT NULL COMMENT '賞与メニュー',
  `ADJUSTMENT` varchar(10) NOT NULL COMMENT '年末調整メニュー',
  `EXPENSE` varchar(10) NOT NULL COMMENT '経費メニュー',
  `SERVICE1` varchar(10) NOT NULL COMMENT 'サービス１メニュー',
  `SERVICE2` varchar(10) NOT NULL COMMENT 'サービス２メニュー',
  `SERVICE3` varchar(10) NOT NULL COMMENT 'サービス３メニュー',
  `SERVICE4` varchar(10) NOT NULL COMMENT 'サービス４メニュー',
  `SERVICE5` varchar(10) NOT NULL COMMENT 'サービス５メニュー',
  `DELETEFLAG` int(10) unsigned NOT NULL default '0' COMMENT '削除フラグ',
  `ADDDT` datetime NOT NULL COMMENT '登録日',
  `ADDCD` varchar(10) NOT NULL COMMENT '登録者',
  `UPDDT` timestamp NOT NULL COMMENT '更新日',
  `UPDCD` varchar(10) NOT NULL COMMENT '更新者',
  PRIMARY KEY  (`AUTHCODE`)
) ENGINE=InnoDB DEFAULT CHARSET=cp932 COMMENT='権限マスタ';

--
-- Table structure for table `CM_COMPONENT`
--

DROP TABLE IF EXISTS `CM_COMPONENT`;
CREATE TABLE `CM_COMPONENT` (
  `COMPCODE` varchar(10) NOT NULL COMMENT 'コマンドユニットコード',
  `DIVISION` varchar(10) NOT NULL COMMENT '分類',
  `COMPNAME` varchar(10) NOT NULL COMMENT 'コマンドユニットネーム',
  `COMPONENT` text NOT NULL COMMENT 'コマンド',
  `MANAGE` int(1) unsigned NOT NULL default '0' COMMENT '利用範囲',
  `DELETEFLAG` int(10) unsigned NOT NULL default '0' COMMENT '削除フラグ',
  `ADDDT` datetime NOT NULL COMMENT '登録日',
  `ADDCD` varchar(10) NOT NULL COMMENT '登録者',
  `UPDDT` timestamp NOT NULL COMMENT '更新日',
  `UPDCD` varchar(10) NOT NULL COMMENT '更新者',
  PRIMARY KEY  (`COMPCODE`)
) ENGINE=InnoDB DEFAULT CHARSET=cp932 COMMENT='メニューコマンドマスタ';

--
-- Table structure for table `CT_WORKFLOW_COMMENT`
--

DROP TABLE IF EXISTS `CT_WORKFLOW_COMMENT`;
CREATE TABLE `CT_WORKFLOW_COMMENT` (
  `COMMENTID` bigint(20) unsigned zerofill NOT NULL default '00000000000000000000' COMMENT 'コメントID',
  `WORKFLOW` bigint(20) unsigned zerofill NOT NULL default '00000000000000000000' COMMENT 'ワークフロー番号',
  `KCODE` varchar(10) NOT NULL COMMENT '社員コード',
  `TARGET` varchar(10) NOT NULL COMMENT '対象者',
  `AUTHORCOMMENT` text NOT NULL COMMENT 'コメント',
  `DELETEFLAG` int(10) unsigned NOT NULL default '0' COMMENT '削除フラグ',
  `ADDDT` datetime NOT NULL COMMENT '登録日',
  `ADDCD` varchar(10) NOT NULL COMMENT '登録者',
  `UPDDT` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP COMMENT '更新日',
  `UPDCD` varchar(10) NOT NULL COMMENT '更新者',
  PRIMARY KEY  (`COMMENTID`)
) ENGINE=InnoDB DEFAULT CHARSET=cp932 COMMENT='ワークフローコメントテーブル';
