﻿--------------------------------------------------------
--  DDL for Table CFG_ROUTE
--------------------------------------------------------

  CREATE TABLE "MIRLE"."CFG_ROUTE" 
  (	
	   "PRODUCT_TYPE" VARCHAR2(10 CHAR), 
	   "ROUTE_TYPE" VARCHAR2(10 CHAR), 
	   "SOURCE_POSITION" VARCHAR2(9 CHAR), 
	   "DEST_POSITION" VARCHAR2(9 CHAR), 
	   "SOFTWARE_ID" VARCHAR2(7 CHAR), 
	   "ESTIMATED_TIME" NUMBER(5,0), 
	   "CREATE_USER" VARCHAR2(30 CHAR), 
	   "CREATE_TIME" TIMESTAMP (6) DEFAULT systimestamp, 
	   "UPDATE_USER" VARCHAR2(30 CHAR), 
	   "UPDATE_TIME" TIMESTAMP (6) DEFAULT systimestamp, 
	   "STATUS" NUMBER(1,0) DEFAULT 0
  ) 
  SEGMENT CREATION IMMEDIATE 
  PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 
  NOCOMPRESS LOGGING
  STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1
  BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
  TABLESPACE "SYSTEM" ;

  COMMENT ON COLUMN "MIRLE"."CFG_ROUTE"."PRODUCT_TYPE" IS '產品類別';
  COMMENT ON COLUMN "MIRLE"."CFG_ROUTE"."ROUTE_TYPE" IS '路線類別';
  COMMENT ON COLUMN "MIRLE"."CFG_ROUTE"."SOURCE_POSITION" IS '起始位置';
  COMMENT ON COLUMN "MIRLE"."CFG_ROUTE"."DEST_POSITION" IS '目的位置';
  COMMENT ON COLUMN "MIRLE"."CFG_ROUTE"."SOFTWARE_ID" IS '軟體編號';
  COMMENT ON COLUMN "MIRLE"."CFG_ROUTE"."ESTIMATED_TIME" IS '預估時間';
  COMMENT ON COLUMN "MIRLE"."CFG_ROUTE"."CREATE_USER" IS '建立人員';
  COMMENT ON COLUMN "MIRLE"."CFG_ROUTE"."CREATE_TIME" IS '建立時間';
  COMMENT ON COLUMN "MIRLE"."CFG_ROUTE"."UPDATE_USER" IS '更新人員';
  COMMENT ON COLUMN "MIRLE"."CFG_ROUTE"."UPDATE_TIME" IS '更新時間';
  COMMENT ON COLUMN "MIRLE"."CFG_ROUTE"."STATUS" IS '資料狀態';

--------------------------------------------------------
--  DDL for Index CFG_ROUTE_PK
--------------------------------------------------------

  CREATE UNIQUE INDEX "MIRLE"."CFG_ROUTE_PK" ON "MIRLE"."CFG_ROUTE" ("PRODUCT_TYPE", "ROUTE_TYPE", "SOURCE_POSITION", "DEST_POSITION") 
  PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS 
  STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1
  BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
  TABLESPACE "SYSTEM" ;

--------------------------------------------------------
--  Constraints for Table CFG_ROUTE
--------------------------------------------------------

  ALTER TABLE "MIRLE"."CFG_ROUTE" MODIFY ("PRODUCT_TYPE" NOT NULL ENABLE);
  ALTER TABLE "MIRLE"."CFG_ROUTE" MODIFY ("ROUTE_TYPE" NOT NULL ENABLE);
  ALTER TABLE "MIRLE"."CFG_ROUTE" MODIFY ("SOURCE_POSITION" NOT NULL ENABLE);
  ALTER TABLE "MIRLE"."CFG_ROUTE" MODIFY ("DEST_POSITION" NOT NULL ENABLE);
  ALTER TABLE "MIRLE"."CFG_ROUTE" MODIFY ("SOFTWARE_ID" NOT NULL ENABLE);
  ALTER TABLE "MIRLE"."CFG_ROUTE" MODIFY ("CREATE_USER" NOT NULL ENABLE);
  ALTER TABLE "MIRLE"."CFG_ROUTE" MODIFY ("CREATE_TIME" NOT NULL ENABLE);
  ALTER TABLE "MIRLE"."CFG_ROUTE" MODIFY ("UPDATE_USER" NOT NULL ENABLE);
  ALTER TABLE "MIRLE"."CFG_ROUTE" MODIFY ("UPDATE_TIME" NOT NULL ENABLE);
  ALTER TABLE "MIRLE"."CFG_ROUTE" MODIFY ("STATUS" NOT NULL ENABLE);
  ALTER TABLE "MIRLE"."CFG_ROUTE" ADD CONSTRAINT "CFG_ROUTE_PK" PRIMARY KEY ("PRODUCT_TYPE", "ROUTE_TYPE", "SOURCE_POSITION", "DEST_POSITION")
  USING INDEX PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS 
  STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1
  BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
  TABLESPACE "SYSTEM"  ENABLE;