h-you / branches / ddl / 20180328_SQL.txt @ 338
履歴 | 表示 | アノテート | ダウンロード (1.22 KB)
| 1 |
-- ?????}?X?^ |
|---|---|
| 2 |
DROP TABLE IF EXISTS departmentmaster_OLD; |
| 3 |
CREATE TABLE departmentmaster_OLD As Select * from departmentmaster; |
| 4 |
|
| 5 |
drop table if exists departmentmaster cascade; |
| 6 |
|
| 7 |
create table departmentmaster ( |
| 8 |
DepartmentCode decimal(5,0) unsigned not null comment '?????R?[?h' |
| 9 |
, DisplayOrder decimal(5,0) unsigned not null comment '?\????' |
| 10 |
, DepartmentString varchar(100) not null comment '??????' |
| 11 |
, ActionScheduleFlg decimal(1,0) not null comment '?s???\??\???t???O' |
| 12 |
, StaffAssignFlg decimal(1,0) not null comment '?l???z?u?\???t???O' |
| 13 |
, StartDate datetime not null comment '?J?n???t' |
| 14 |
, CompDate datetime not null comment '?I?????t' |
| 15 |
, DeleteFlg decimal(1,0) not null comment '???t???O' |
| 16 |
, EntryDate datetime not null comment '?o?^???t' |
| 17 |
, UpdateDate datetime not null comment '?X?V???t' |
| 18 |
, constraint departmentmaster_PKC primary key (DepartmentCode) |
| 19 |
) comment '?????}?X?^' ; |
| 20 |
|
| 21 |
create index DepartmentMaster_index1 |
| 22 |
on departmentmaster(DisplayOrder); |
| 23 |
|
| 24 |
Insert INTO departmentmaster |
| 25 |
SELECT |
| 26 |
DepartmentCode |
| 27 |
, DisplayOrder |
| 28 |
, DepartmentString |
| 29 |
, ActionScheduleFlg |
| 30 |
, StaffAssignFlg |
| 31 |
, NOW() |
| 32 |
, DATE('0001/01/01')
|
| 33 |
, DeleteFlg |
| 34 |
, EntryDate |
| 35 |
, UpdateDate |
| 36 |
From departmentmaster_OLD |
| 37 |
; |
| 38 |
commit; |