-- 部署マスタ DROP TABLE IF EXISTS departmentmaster_OLD; CREATE TABLE departmentmaster_OLD As Select * from departmentmaster; drop table if exists departmentmaster cascade; create table departmentmaster ( DepartmentCode decimal(5,0) unsigned not null comment '部署コード' , DisplayOrder decimal(5,0) unsigned not null comment '表示順' , DepartmentString varchar(100) not null comment '部署名' , ActionScheduleFlg decimal(1,0) not null comment '行動予定表示フラグ' , StaffAssignFlg decimal(1,0) not null comment '人員配置表示フラグ' , StartDate datetime not null comment '開始日付' , CompDate datetime not null comment '終了日付' , DeleteFlg decimal(1,0) not null comment '削除フラグ' , EntryDate datetime not null comment '登録日付' , UpdateDate datetime not null comment '更新日付' , constraint departmentmaster_PKC primary key (DepartmentCode) ) comment '部署マスタ' ; create index DepartmentMaster_index1 on departmentmaster(DisplayOrder); Insert INTO departmentmaster SELECT DepartmentCode , DisplayOrder , DepartmentString , ActionScheduleFlg , StaffAssignFlg , NOW() , DATE('0001/01/01') , DeleteFlg , EntryDate , UpdateDate From departmentmaster_OLD ; commit;