﻿--------------------------------------------------------
--  DDL for Table CFG_STATION
--------------------------------------------------------

  CREATE TABLE "MIRLE"."CFG_STATION" 
  (	
	   "STORAGE_ID" VARCHAR2(7 CHAR), 
	   "STATION_ID" VARCHAR2(9 CHAR), 
	   "STATION_NAME" VARCHAR2(30 CHAR), 
	   "STATION_DESC" VARCHAR2(50 CHAR), 
	   "LEVEL_Z" VARCHAR2(1 BYTE) DEFAULT 1
	   "AXIS_X" NUMBER(6,2) DEFAULT 0.0, 
	   "AXIS_Y" NUMBER(6,2) DEFAULT 0.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_STATION"."STORAGE_ID" IS '儲存區編號';
  COMMENT ON COLUMN "MIRLE"."CFG_STATION"."STATION_ID" IS '站點編號';
  COMMENT ON COLUMN "MIRLE"."CFG_STATION"."STATION_NAME" IS '站點名稱';
  COMMENT ON COLUMN "MIRLE"."CFG_STATION"."STATION_DESC" IS '站點敘述';
  COMMENT ON COLUMN "MIRLE"."CFG_STATION"."LEVEL_Z" IS '層';
  COMMENT ON COLUMN "MIRLE"."CFG_STATION"."AXIS_X" IS '圖座標 X';
  COMMENT ON COLUMN "MIRLE"."CFG_STATION"."AXIS_Y" IS '圖座標 Y';
  COMMENT ON COLUMN "MIRLE"."CFG_STATION"."CREATE_USER" IS '建立人員';
  COMMENT ON COLUMN "MIRLE"."CFG_STATION"."CREATE_TIME" IS '建立時間';
  COMMENT ON COLUMN "MIRLE"."CFG_STATION"."UPDATE_USER" IS '更新人員';
  COMMENT ON COLUMN "MIRLE"."CFG_STATION"."UPDATE_TIME" IS '更新時間';
  COMMENT ON COLUMN "MIRLE"."CFG_STATION"."STATUS" IS '資料狀態';

--------------------------------------------------------
--  DDL for Index CFG_STATION_PK
--------------------------------------------------------

  CREATE UNIQUE INDEX "MIRLE"."CFG_STATION_PK" ON "MIRLE"."CFG_STATION" ("STORAGE_ID", "STATION_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_STATION
--------------------------------------------------------

  ALTER TABLE "MIRLE"."CFG_STATION" MODIFY ("STORAGE_ID" NOT NULL ENABLE);
  ALTER TABLE "MIRLE"."CFG_STATION" MODIFY ("STATION_ID" NOT NULL ENABLE);
  ALTER TABLE "MIRLE"."CFG_STATION" MODIFY ("STATION_NAME" NOT NULL ENABLE);
  ALTER TABLE "MIRLE"."CFG_STATION" MODIFY ("LEVEL_Z" NOT NULL ENABLE);
  ALTER TABLE "MIRLE"."CFG_STATION" MODIFY ("CREATE_USER" NOT NULL ENABLE);
  ALTER TABLE "MIRLE"."CFG_STATION" MODIFY ("CREATE_TIME" NOT NULL ENABLE);
  ALTER TABLE "MIRLE"."CFG_STATION" MODIFY ("UPDATE_USER" NOT NULL ENABLE);
  ALTER TABLE "MIRLE"."CFG_STATION" MODIFY ("UPDATE_TIME" NOT NULL ENABLE);
  ALTER TABLE "MIRLE"."CFG_STATION" MODIFY ("STATUS" NOT NULL ENABLE);
  ALTER TABLE "MIRLE"."CFG_STATION" ADD CONSTRAINT "CFG_STATION_PK" PRIMARY KEY ("STORAGE_ID", "STATION_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;