forked from dhrod0325/saboard
-
Notifications
You must be signed in to change notification settings - Fork 0
/
saboard_oracle.sql
173 lines (152 loc) · 5.43 KB
/
saboard_oracle.sql
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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
DROP TABLE "DHROD0325"."SA_BOARD";
CREATE TABLE "DHROD0325"."SA_BOARD" (
"ID" NUMBER NOT NULL ,
"BOARD_ID" VARCHAR2(200 BYTE) NOT NULL ,
"USER_ID" VARCHAR2(20 BYTE) NOT NULL ,
"PASSWORD" VARCHAR2(30 BYTE) NOT NULL ,
"TITLE" VARCHAR2(200 BYTE) NOT NULL ,
"REG_DATE" DATE NOT NULL ,
"HAS_FILE" VARCHAR2(10 BYTE) NOT NULL ,
"CONTENT" CLOB NULL
)
LOGGING
NOCOMPRESS
NOCACHE
;
DROP TABLE "DHROD0325"."SA_BOARD_FILE";
CREATE TABLE "DHROD0325"."SA_BOARD_FILE" (
"NO" NUMBER NOT NULL ,
"ID" NUMBER NOT NULL ,
"FILE_NAME" VARCHAR2(120 BYTE) NOT NULL ,
"FILE_SIZE" NUMBER NOT NULL ,
"FILE_REG_DATE" DATE NOT NULL
)
LOGGING
NOCOMPRESS
NOCACHE;
DROP TABLE "DHROD0325"."SA_BOARD_REPLY";
CREATE TABLE "DHROD0325"."SA_BOARD_REPLY" (
"ID" NUMBER NOT NULL ,
"NO" NUMBER NOT NULL ,
"USER_ID" VARCHAR2(20 BYTE) NOT NULL ,
"PASSWORD" VARCHAR2(20 BYTE) NOT NULL ,
"EMAIL" VARCHAR2(20 BYTE) NULL ,
"TITLE" VARCHAR2(200 BYTE) DEFAULT NULL NULL ,
"REG_DATE" VARCHAR2(40 BYTE) NOT NULL ,
"CONTENT" CLOB NULL
)
LOGGING
NOCOMPRESS
NOCACHE
;
DROP TABLE "DHROD0325"."SA_BOARD_TABLES";
CREATE TABLE "DHROD0325"."SA_BOARD_TABLES" (
"ID" NUMBER NOT NULL ,
"BOARD_ID" VARCHAR2(200 BYTE) NOT NULL ,
"BOARD_NM" VARCHAR2(200 BYTE) DEFAULT NULL NULL ,
"BOARD_DESC" VARCHAR2(200 BYTE) DEFAULT NULL NULL ,
"THEME" VARCHAR2(200 BYTE) NOT NULL
)
LOGGING
NOCOMPRESS
NOCACHE
;
DROP TABLE "DHROD0325"."SA_MEMBER";
CREATE TABLE "DHROD0325"."SA_MEMBER" (
"NO" NUMBER NOT NULL ,
"ID" VARCHAR2(20 BYTE) NOT NULL ,
"PW" VARCHAR2(10 BYTE) NOT NULL ,
"NAME" VARCHAR2(20 BYTE) NOT NULL ,
"ROLE" NUMBER NOT NULL
)
LOGGING
NOCOMPRESS
NOCACHE;
DROP SEQUENCE "DHROD0325"."BOARD_REPLY_SEQ";
CREATE SEQUENCE "DHROD0325"."BOARD_REPLY_SEQ"
INCREMENT BY 1
MINVALUE 0
MAXVALUE 999999999999999999999999999
START WITH 1
NOCACHE;
DROP SEQUENCE "DHROD0325"."BOARD_SEQ";
CREATE SEQUENCE "DHROD0325"."BOARD_SEQ"
INCREMENT BY 1
MINVALUE 0
MAXVALUE 999999999999999999999999999
START WITH 1
NOCACHE;
DROP SEQUENCE "DHROD0325"."BOARD_TABLE_SEQ";
CREATE SEQUENCE "DHROD0325"."BOARD_TABLE_SEQ"
INCREMENT BY 1
MINVALUE 0
MAXVALUE 999999999999999999999999999
START WITH 1
NOCACHE;
DROP SEQUENCE "DHROD0325"."BOARD_FILE_SEQ";
CREATE SEQUENCE "DHROD0325"."BOARD_FILE_SEQ"
INCREMENT BY 1
MINVALUE 0
MAXVALUE 999999999999999999999999999
START WITH 1
NOCACHE;
DROP SEQUENCE "DHROD0325"."SA_MEMBER_SEQ";
CREATE SEQUENCE "DHROD0325"."SA_MEMBER_SEQ"
INCREMENT BY 1
MINVALUE 0
MAXVALUE 999999999999999999999999999
START WITH 1
NOCACHE;
DROP SEQUENCE "DHROD0325"."SA_MEMBER_ROLE_SEQ";
CREATE SEQUENCE "DHROD0325"."SA_MEMBER_ROLE_SEQ"
INCREMENT BY 1
MINVALUE 0
MAXVALUE 999999999999999999999999999
START WITH 1
NOCACHE;
DROP SEQUENCE "DHROD0325"."LINENUM";
CREATE SEQUENCE "DHROD0325"."LINENUM"
INCREMENT BY 1
MINVALUE 1
MAXVALUE 999999999999999999999999999
START WITH 1
CACHE 10000;
DROP SEQUENCE "DHROD0325"."ORDERNUM";
CREATE SEQUENCE "DHROD0325"."ORDERNUM"
INCREMENT BY 1
MINVALUE 1
MAXVALUE 999999999999999999999999999
START WITH 1
CACHE 10000;
ALTER TABLE "DHROD0325"."SA_BOARD" ADD CHECK ("ID" IS NOT NULL);
ALTER TABLE "DHROD0325"."SA_BOARD" ADD CHECK ("BOARD_ID" IS NOT NULL);
ALTER TABLE "DHROD0325"."SA_BOARD" ADD CHECK ("USER_ID" IS NOT NULL);
ALTER TABLE "DHROD0325"."SA_BOARD" ADD CHECK ("PASSWORD" IS NOT NULL);
ALTER TABLE "DHROD0325"."SA_BOARD" ADD CHECK ("TITLE" IS NOT NULL);
ALTER TABLE "DHROD0325"."SA_BOARD" ADD CHECK ("REG_DATE" IS NOT NULL);
ALTER TABLE "DHROD0325"."SA_BOARD" ADD CHECK ("HAS_FILE" IS NOT NULL);
ALTER TABLE "DHROD0325"."SA_BOARD" ADD PRIMARY KEY ("ID");
ALTER TABLE "DHROD0325"."SA_BOARD_FILE" ADD CHECK ("NO" IS NOT NULL);
ALTER TABLE "DHROD0325"."SA_BOARD_FILE" ADD CHECK ("ID" IS NOT NULL);
ALTER TABLE "DHROD0325"."SA_BOARD_FILE" ADD CHECK ("FILE_NAME" IS NOT NULL);
ALTER TABLE "DHROD0325"."SA_BOARD_FILE" ADD CHECK ("FILE_SIZE" IS NOT NULL);
ALTER TABLE "DHROD0325"."SA_BOARD_FILE" ADD CHECK ("FILE_REG_DATE" IS NOT NULL);
ALTER TABLE "DHROD0325"."SA_BOARD_FILE" ADD PRIMARY KEY ("NO");
ALTER TABLE "DHROD0325"."SA_BOARD_REPLY" ADD CHECK ("ID" IS NOT NULL);
ALTER TABLE "DHROD0325"."SA_BOARD_REPLY" ADD CHECK ("NO" IS NOT NULL);
ALTER TABLE "DHROD0325"."SA_BOARD_REPLY" ADD CHECK ("USER_ID" IS NOT NULL);
ALTER TABLE "DHROD0325"."SA_BOARD_REPLY" ADD CHECK ("PASSWORD" IS NOT NULL);
ALTER TABLE "DHROD0325"."SA_BOARD_REPLY" ADD CHECK ("REG_DATE" IS NOT NULL);
ALTER TABLE "DHROD0325"."SA_BOARD_REPLY" ADD PRIMARY KEY ("ID");
ALTER TABLE "DHROD0325"."SA_BOARD_TABLES" ADD CHECK ("ID" IS NOT NULL);
ALTER TABLE "DHROD0325"."SA_BOARD_TABLES" ADD CHECK ("BOARD_ID" IS NOT NULL);
ALTER TABLE "DHROD0325"."SA_BOARD_TABLES" ADD CHECK ("THEME" IS NOT NULL);
ALTER TABLE "DHROD0325"."SA_BOARD_TABLES" ADD PRIMARY KEY ("ID");
ALTER TABLE "DHROD0325"."SA_MEMBER" ADD CHECK ("NO" IS NOT NULL);
ALTER TABLE "DHROD0325"."SA_MEMBER" ADD CHECK ("ID" IS NOT NULL);
ALTER TABLE "DHROD0325"."SA_MEMBER" ADD CHECK ("PW" IS NOT NULL);
ALTER TABLE "DHROD0325"."SA_MEMBER" ADD CHECK ("NAME" IS NOT NULL);
ALTER TABLE "DHROD0325"."SA_MEMBER" ADD CHECK ("ROLE" IS NOT NULL);
ALTER TABLE "DHROD0325"."SA_MEMBER" ADD PRIMARY KEY ("NO");
ALTER TABLE "DHROD0325"."SA_BOARD_FILE" ADD FOREIGN KEY ("NO") REFERENCES "DHROD0325"."SA_BOARD" ("ID") ON DELETE CASCADE;
ALTER TABLE "DHROD0325"."SA_BOARD_REPLY" ADD FOREIGN KEY ("NO") REFERENCES "DHROD0325"."SA_BOARD" ("ID") ON DELETE CASCADE;