h-you / trunk / ddl / 工事種別作業単価マスタ変更.sql
履歴 | 表示 | アノテート | ダウンロード (1.26 KB)
| 1 |
-- ???P???}?X?^
|
|---|---|
| 2 |
drop table if exists constructionspecunitprice_OLD cascade; |
| 3 |
CREATE TABLE constructionspecunitprice_OLD As Select * from constructionspecunitprice; |
| 4 |
|
| 5 |
drop table if exists constructionspecunitprice cascade; |
| 6 |
|
| 7 |
create table constructionspecunitprice ( |
| 8 |
ConstructionTypeCode mediumint(8) unsigned not null comment '?H?????R?[?h' |
| 9 |
, ComponentCode decimal(5,0) unsigned not null comment '?\???L?[' |
| 10 |
, ItemCode decimal(5,0) unsigned not null comment '?H??L?[' |
| 11 |
, SpecCode decimal(5,0) unsigned not null comment '???L?[' |
| 12 |
, UnitPrice decimal(9,2) not null comment '?P??' |
| 13 |
, EntryDate datetime not null comment '?o?^???t' |
| 14 |
, UpdateDate datetime not null comment '?X?V???t' |
| 15 |
, constraint constructionspecunitprice_PKC primary key (ConstructionTypeCode,ComponentCode,ItemCode,SpecCode) |
| 16 |
) comment '???P???}?X?^' ; |
| 17 |
|
| 18 |
create index constructionspecunitprice_Index1 |
| 19 |
on constructionspecunitprice(ConstructionTypeCode,ComponentCode,ItemCode);
|
| 20 |
|
| 21 |
create index constructionspecunitprice_Index2 |
| 22 |
on constructionspecunitprice(ItemCode,SpecCode);
|
| 23 |
|
| 24 |
Insert INTO constructionspecunitprice |
| 25 |
SELECT
|
| 26 |
ConstructionTypeCode |
| 27 |
, ComponentCode |
| 28 |
, ItemCode |
| 29 |
, SpecCode |
| 30 |
, UnitPrice |
| 31 |
, EntryDate |
| 32 |
, UpdateDate |
| 33 |
FROM constructionspecunitprice_OLD
|
| 34 |
; |
| 35 |
commit;
|