﻿--------------------------------------------------------
--  DDL for Table CFG_WAREHOUSE
--------------------------------------------------------

  CREATE TABLE "MIRLE"."CFG_WAREHOUSE" 
  (	
	  "WAREHOUSE_ID" VARCHAR2(5 CHAR), 
	  "WAREHOUSE_NAME" VARCHAR2(30 CHAR), 
	  "WAREHOUSE_DESC" VARCHAR2(50 CHAR), 
	  "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_WAREHOUSE"."WAREHOUSE_ID" IS '倉庫編號';
  COMMENT ON COLUMN "MIRLE"."CFG_WAREHOUSE"."WAREHOUSE_NAME" IS '倉庫名稱';
  COMMENT ON COLUMN "MIRLE"."CFG_WAREHOUSE"."WAREHOUSE_DESC" IS '倉庫敘述';
  COMMENT ON COLUMN "MIRLE"."CFG_WAREHOUSE"."CREATE_USER" IS '建立人員';
  COMMENT ON COLUMN "MIRLE"."CFG_WAREHOUSE"."CREATE_TIME" IS '建立時間';
  COMMENT ON COLUMN "MIRLE"."CFG_WAREHOUSE"."UPDATE_USER" IS '更新人員';
  COMMENT ON COLUMN "MIRLE"."CFG_WAREHOUSE"."UPDATE_TIME" IS '更新時間';
  COMMENT ON COLUMN "MIRLE"."CFG_WAREHOUSE"."STATUS" IS '資料狀態';

--------------------------------------------------------
--  DDL for Index CFG_WAREHOUSE_PK
--------------------------------------------------------

  CREATE UNIQUE INDEX "MIRLE"."CFG_WAREHOUSE_PK" ON "MIRLE"."CFG_WAREHOUSE" ("WAREHOUSE_ID") 
  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_WAREHOUSE
--------------------------------------------------------

  ALTER TABLE "MIRLE"."CFG_WAREHOUSE" MODIFY ("WAREHOUSE_ID" NOT NULL ENABLE);
  ALTER TABLE "MIRLE"."CFG_WAREHOUSE" MODIFY ("WAREHOUSE_NAME" NOT NULL ENABLE);
  ALTER TABLE "MIRLE"."CFG_WAREHOUSE" MODIFY ("CREATE_USER" NOT NULL ENABLE);
  ALTER TABLE "MIRLE"."CFG_WAREHOUSE" MODIFY ("CREATE_TIME" NOT NULL ENABLE);
  ALTER TABLE "MIRLE"."CFG_WAREHOUSE" MODIFY ("UPDATE_USER" NOT NULL ENABLE);
  ALTER TABLE "MIRLE"."CFG_WAREHOUSE" MODIFY ("UPDATE_TIME" NOT NULL ENABLE);
  ALTER TABLE "MIRLE"."CFG_WAREHOUSE" MODIFY ("STATUS" NOT NULL ENABLE);
  ALTER TABLE "MIRLE"."CFG_WAREHOUSE" ADD CONSTRAINT "CFG_WAREHOUSE_PK" PRIMARY KEY ("WAREHOUSE_ID")
  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;