forked from gg-gg-codes/Notes
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathddl
64 lines (59 loc) · 3.06 KB
/
ddl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
--------------------------------------------------------
-- DDL for Table USERS
--------------------------------------------------------
CREATE TABLE "SYSTEM"."USERS"
( "ID" NUMBER(38,0) GENERATED BY DEFAULT AS IDENTITY MINVALUE 1 MAXVALUE 9999999999999999999999999999 INCREMENT BY 1 START WITH 1 CACHE 20 NOORDER NOCYCLE ,
"CREATED_AT" NUMBER(38,0),
"MODIFIED_AT" NUMBER(38,0),
"CREATED_BY" VARCHAR2(255 BYTE),
"MODIFIED_BY" VARCHAR2(255 BYTE),
"USER_ID" VARCHAR2(255 BYTE),
"NATCO" NUMBER(38,0),
"PERMISSIONS" VARCHAR2(30 BYTE)
) 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" ;
--------------------------------------------------------
-- DDL for Index PK_USERS
--------------------------------------------------------
CREATE UNIQUE INDEX "SYSTEM"."PK_USERS" ON "SYSTEM"."USERS" ("ID")
PCTFREE 10 INITRANS 2 MAXTRANS 255
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" ;
--------------------------------------------------------
-- DDL for Index UC_USERS_USER
--------------------------------------------------------
CREATE UNIQUE INDEX "SYSTEM"."UC_USERS_USER" ON "SYSTEM"."USERS" ("USER_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 USERS
--------------------------------------------------------
ALTER TABLE "SYSTEM"."USERS" ADD CONSTRAINT "UC_USERS_USER" UNIQUE ("USER_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;
ALTER TABLE "SYSTEM"."USERS" ADD CONSTRAINT "PK_USERS" PRIMARY KEY ("ID")
USING INDEX PCTFREE 10 INITRANS 2 MAXTRANS 255
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;
ALTER TABLE "SYSTEM"."USERS" MODIFY ("USER_ID" NOT NULL ENABLE);
ALTER TABLE "SYSTEM"."USERS" MODIFY ("CREATED_AT" NOT NULL ENABLE);
ALTER TABLE "SYSTEM"."USERS" MODIFY ("ID" NOT NULL ENABLE);
--------------------------------------------------------
-- Ref Constraints for Table USERS
--------------------------------------------------------
ALTER TABLE "SYSTEM"."USERS" ADD CONSTRAINT "FK_USERS_ON_NATCO" FOREIGN KEY ("NATCO")
REFERENCES "SYSTEM"."NATCOS" ("ID") ENABLE;