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 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446
|
select table_name,table_type from cat where table_type in ('TABLE','VIEW');
CREATE TABLE m_config_tbl (
config_id VARCHAR(64) NOT NULL,
project_id DECIMAL(10) DEFAULT 0 NOT NULL,
user_id DECIMAL(10) DEFAULT 0 NOT NULL,
access_reqd DECIMAL(10) DEFAULT 0,
type DECIMAL(10) DEFAULT 90,
value VARCHAR(4000) NOT NULL,
PRIMARY KEY (config_id, project_id, user_id)
);
CREATE INDEX idx_config ON m_config_tbl (config_id);
CREATE TABLE m_bug_file_tbl (
id DECIMAL(10) NOT NULL,
bug_id DECIMAL(10) DEFAULT 0 NOT NULL,
title VARCHAR(250) DEFAULT '',
description VARCHAR(250) DEFAULT '',
diskfile VARCHAR(250) DEFAULT '',
filename VARCHAR(250) DEFAULT '',
folder VARCHAR(250) DEFAULT '',
filesize DECIMAL(10) DEFAULT 0 NOT NULL,
file_type VARCHAR(250) DEFAULT '',
date_added DATE DEFAULT '01-01-1970' NOT NULL,
content BLOB NOT NULL,
PRIMARY KEY (id)
);
CREATE SEQUENCE SEQ_m_bug_file_tbl ;
CREATE OR REPLACE TRIGGER TRIG_SEQ_m_bug_file_tbl BEFORE insert ON m_bug_file_tbl FOR EACH ROW WHEN (NEW.id IS NULL OR NEW.id = 0) BEGIN select SEQ_m_bug_file_tbl.nextval into :new.id from dual; END;
CREATE INDEX idx_bug_file_bug_id ON m_bug_file_tbl (bug_id);
CREATE TABLE m_bug_history_tbl (
id DECIMAL(10) NOT NULL,
user_id DECIMAL(10) DEFAULT 0 NOT NULL,
bug_id DECIMAL(10) DEFAULT 0 NOT NULL,
date_modified DATE DEFAULT '01-01-1970' NOT NULL,
field_name VARCHAR(32) DEFAULT '',
old_value VARCHAR(128) DEFAULT '',
new_value VARCHAR(128) DEFAULT '',
type DECIMAL(5) DEFAULT 0 NOT NULL,
PRIMARY KEY (id)
);
CREATE SEQUENCE SEQ_m_bug_history_tbl ;
CREATE OR REPLACE TRIGGER TRIG_SEQ_m_bug_history_tbl BEFORE insert ON m_bug_history_tbl FOR EACH ROW WHEN (NEW.id IS NULL OR NEW.id = 0) BEGIN select SEQ_m_bug_history_tbl.nextval into :new.id from dual; END;
CREATE INDEX idx_bug_history_bug_id ON m_bug_history_tbl (bug_id);
CREATE INDEX idx_history_user_id ON m_bug_history_tbl (user_id);
CREATE TABLE m_bug_monitor_tbl (
user_id DECIMAL(10) DEFAULT 0 NOT NULL,
bug_id DECIMAL(10) DEFAULT 0 NOT NULL,
PRIMARY KEY (user_id, bug_id)
);
CREATE TABLE m_bug_relationship_tbl (
id DECIMAL(10) NOT NULL,
source_bug_id DECIMAL(10) DEFAULT 0 NOT NULL,
destination_bug_id DECIMAL(10) DEFAULT 0 NOT NULL,
relationship_type DECIMAL(5) DEFAULT 0 NOT NULL,
PRIMARY KEY (id)
);
CREATE SEQUENCE SEQ_m_bug_relationship_tbl ;
CREATE OR REPLACE TRIGGER TRIG_SEQ_m_bug_relationship_tbl BEFORE insert ON m_bug_relationship_tbl FOR EACH ROW WHEN (NEW.id IS NULL OR NEW.id = 0) BEGIN select SEQ_m_bug_relationship_tbl.nextval into :new.id from dual; END;
CREATE INDEX idx_relationship_source ON m_bug_relationship_tbl (source_bug_id);
CREATE INDEX idx_relationship_destination ON m_bug_relationship_tbl (destination_bug_id);
CREATE TABLE m_bug_tbl (
id DECIMAL(10) NOT NULL,
project_id DECIMAL(10) DEFAULT 0 NOT NULL,
reporter_id DECIMAL(10) DEFAULT 0 NOT NULL,
handler_id DECIMAL(10) DEFAULT 0 NOT NULL,
duplicate_id DECIMAL(10) DEFAULT 0 NOT NULL,
priority DECIMAL(5) DEFAULT 30 NOT NULL,
severity DECIMAL(5) DEFAULT 50 NOT NULL,
reproducibility DECIMAL(5) DEFAULT 10 NOT NULL,
status DECIMAL(5) DEFAULT 10 NOT NULL,
resolution DECIMAL(5) DEFAULT 10 NOT NULL,
projection DECIMAL(5) DEFAULT 10 NOT NULL,
category VARCHAR(64) DEFAULT '',
date_submitted DATE DEFAULT '01-01-1970' NOT NULL,
last_updated DATE DEFAULT '01-01-1970' NOT NULL,
eta DECIMAL(5) DEFAULT 10 NOT NULL,
bug_text_id DECIMAL(10) DEFAULT 0 NOT NULL,
os VARCHAR(32) DEFAULT '',
os_build VARCHAR(32) DEFAULT '',
platform VARCHAR(32) DEFAULT '',
version VARCHAR(64) DEFAULT '',
fixed_in_version VARCHAR(64) DEFAULT '',
build VARCHAR(32) DEFAULT '',
profile_id DECIMAL(10) DEFAULT 0 NOT NULL,
view_state DECIMAL(5) DEFAULT 10 NOT NULL,
summary VARCHAR(128) DEFAULT '',
sponsorship_total DECIMAL(10) DEFAULT 0 NOT NULL,
sticky DECIMAL(1) DEFAULT 0 NOT NULL,
PRIMARY KEY (id)
);
CREATE SEQUENCE SEQ_m_bug_tbl ;
CREATE OR REPLACE TRIGGER TRIG_SEQ_m_bug_tbl BEFORE insert ON m_bug_tbl FOR EACH ROW WHEN (NEW.id IS NULL OR NEW.id = 0) BEGIN select SEQ_m_bug_tbl.nextval into :new.id from dual; END;
CREATE INDEX idx_bug_sponsorship_total ON m_bug_tbl (sponsorship_total);
CREATE INDEX idx_bug_fixed_in_version ON m_bug_tbl (fixed_in_version);
CREATE INDEX idx_bug_status ON m_bug_tbl (status);
CREATE INDEX idx_project ON m_bug_tbl (project_id);
CREATE TABLE m_bug_text_tbl (
id DECIMAL(10) NOT NULL,
description VARCHAR(4000) NOT NULL,
steps_to_reproduce VARCHAR(4000) NOT NULL,
additional_information VARCHAR(4000) NOT NULL,
PRIMARY KEY (id)
);
CREATE SEQUENCE SEQ_m_bug_text_tbl ;
CREATE OR REPLACE TRIGGER TRIG_SEQ_m_bug_text_tbl BEFORE insert ON m_bug_text_tbl FOR EACH ROW WHEN (NEW.id IS NULL OR NEW.id = 0) BEGIN select SEQ_m_bug_text_tbl.nextval into :new.id from dual; END;
CREATE TABLE m_bugnote_tbl (
id DECIMAL(10) NOT NULL,
bug_id DECIMAL(10) DEFAULT 0 NOT NULL,
reporter_id DECIMAL(10) DEFAULT 0 NOT NULL,
bugnote_text_id DECIMAL(10) DEFAULT 0 NOT NULL,
view_state DECIMAL(5) DEFAULT 10 NOT NULL,
date_submitted DATE DEFAULT '01-01-1970' NOT NULL,
last_modified DATE DEFAULT '01-01-1970' NOT NULL,
note_type DECIMAL(10) DEFAULT 0,
note_attr VARCHAR(250) DEFAULT '',
PRIMARY KEY (id)
);
CREATE SEQUENCE SEQ_m_bugnote_tbl ;
CREATE OR REPLACE TRIGGER TRIG_SEQ_m_bugnote_tbl BEFORE insert ON m_bugnote_tbl FOR EACH ROW WHEN (NEW.id IS NULL OR NEW.id = 0) BEGIN select SEQ_m_bugnote_tbl.nextval into :new.id from dual; END;
CREATE INDEX idx_bug ON m_bugnote_tbl (bug_id);
CREATE INDEX idx_last_mod ON m_bugnote_tbl (last_modified);
CREATE TABLE m_bugnote_text_tbl (
id DECIMAL(10) NOT NULL,
note VARCHAR(4000) NOT NULL,
PRIMARY KEY (id)
);
CREATE SEQUENCE SEQ_m_bugnote_text_tbl ;
CREATE OR REPLACE TRIGGER TRIG_SEQ_m_bugnote_text_tbl BEFORE insert ON m_bugnote_text_tbl FOR EACH ROW WHEN (NEW.id IS NULL OR NEW.id = 0) BEGIN select SEQ_m_bugnote_text_tbl.nextval into :new.id from dual; END;
CREATE TABLE m_custom_field_project_tbl (
field_id DECIMAL(10) DEFAULT 0 NOT NULL,
project_id DECIMAL(10) DEFAULT 0 NOT NULL,
sequence DECIMAL(5) DEFAULT 0 NOT NULL,
PRIMARY KEY (field_id, project_id)
);
CREATE TABLE m_custom_field_string_tbl (
field_id DECIMAL(10) DEFAULT 0 NOT NULL,
bug_id DECIMAL(10) DEFAULT 0 NOT NULL,
value VARCHAR(255) DEFAULT '',
PRIMARY KEY (field_id, bug_id)
);
CREATE INDEX idx_custom_field_bug ON m_custom_field_string_tbl (bug_id);
CREATE TABLE m_custom_field_tbl (
id DECIMAL(10) NOT NULL,
name VARCHAR(64) DEFAULT '',
type DECIMAL(5) DEFAULT 0 NOT NULL,
possible_values VARCHAR(255) DEFAULT '',
default_value VARCHAR(255) DEFAULT '',
valid_regexp VARCHAR(255) DEFAULT '',
access_level_r DECIMAL(5) DEFAULT 0 NOT NULL,
access_level_rw DECIMAL(5) DEFAULT 0 NOT NULL,
length_min DECIMAL(10) DEFAULT 0 NOT NULL,
length_max DECIMAL(10) DEFAULT 0 NOT NULL,
advanced DECIMAL(1) DEFAULT 0 NOT NULL,
require_report DECIMAL(1) DEFAULT 0 NOT NULL,
require_update DECIMAL(1) DEFAULT 0 NOT NULL,
display_report DECIMAL(1) DEFAULT 1 NOT NULL,
display_update DECIMAL(1) DEFAULT 1 NOT NULL,
require_resolved DECIMAL(1) DEFAULT 0 NOT NULL,
display_resolved DECIMAL(1) DEFAULT 0 NOT NULL,
display_closed DECIMAL(1) DEFAULT 0 NOT NULL,
require_closed DECIMAL(1) DEFAULT 0 NOT NULL,
PRIMARY KEY (id)
);
CREATE SEQUENCE SEQ_m_custom_field_tbl ;
CREATE OR REPLACE TRIGGER TRIG_SEQ_m_custom_field_tbl BEFORE insert ON m_custom_field_tbl FOR EACH ROW WHEN (NEW.id IS NULL OR NEW.id = 0) BEGIN select SEQ_m_custom_field_tbl.nextval into :new.id from dual; END;
CREATE INDEX idx_custom_field_name ON m_custom_field_tbl (name);
CREATE TABLE m_filters_tbl (
id DECIMAL(10) NOT NULL,
user_id DECIMAL(10) DEFAULT 0 NOT NULL,
project_id DECIMAL(10) DEFAULT 0 NOT NULL,
is_public DECIMAL(1) DEFAULT NULL,
name VARCHAR(64) DEFAULT '',
filter_string VARCHAR(4000) NOT NULL,
PRIMARY KEY (id)
);
CREATE SEQUENCE SEQ_m_filters_tbl ;
CREATE OR REPLACE TRIGGER TRIG_SEQ_m_filters_tbl BEFORE insert ON m_filters_tbl FOR EACH ROW WHEN (NEW.id IS NULL OR NEW.id = 0) BEGIN select SEQ_m_filters_tbl.nextval into :new.id from dual; END;
CREATE TABLE m_news_tbl (
id DECIMAL(10) NOT NULL,
project_id DECIMAL(10) DEFAULT 0 NOT NULL,
poster_id DECIMAL(10) DEFAULT 0 NOT NULL,
date_posted DATE DEFAULT '01-01-1970' NOT NULL,
last_modified DATE DEFAULT '01-01-1970' NOT NULL,
view_state DECIMAL(5) DEFAULT 10 NOT NULL,
announcement DECIMAL(1) DEFAULT 0 NOT NULL,
headline VARCHAR(64) DEFAULT '',
body VARCHAR(4000) NOT NULL,
PRIMARY KEY (id)
);
CREATE SEQUENCE SEQ_m_news_tbl ;
CREATE OR REPLACE TRIGGER TRIG_SEQ_m_news_tbl BEFORE insert ON m_news_tbl FOR EACH ROW WHEN (NEW.id IS NULL OR NEW.id = 0) BEGIN select SEQ_m_news_tbl.nextval into :new.id from dual; END;
CREATE TABLE m_project_category_tbl (
project_id DECIMAL(10) DEFAULT 0 NOT NULL,
category VARCHAR(64) DEFAULT '',
user_id DECIMAL(10) DEFAULT 0 NOT NULL,
PRIMARY KEY (project_id, category)
);
CREATE TABLE m_project_file_tbl (
id DECIMAL(10) NOT NULL,
project_id DECIMAL(10) DEFAULT 0 NOT NULL,
title VARCHAR(250) DEFAULT '',
description VARCHAR(250) DEFAULT '',
diskfile VARCHAR(250) DEFAULT '',
filename VARCHAR(250) DEFAULT '',
folder VARCHAR(250) DEFAULT '',
filesize DECIMAL(10) DEFAULT 0 NOT NULL,
file_type VARCHAR(250) DEFAULT '',
date_added DATE DEFAULT '01-01-1970' NOT NULL,
content BLOB NOT NULL,
PRIMARY KEY (id)
);
CREATE SEQUENCE SEQ_m_project_file_tbl ;
CREATE OR REPLACE TRIGGER TRIG_SEQ_m_project_file_tbl BEFORE insert ON m_project_file_tbl FOR EACH ROW WHEN (NEW.id IS NULL OR NEW.id = 0) BEGIN select SEQ_m_project_file_tbl.nextval into :new.id from dual; END;
CREATE TABLE m_project_hierarchy_tbl (
child_id DECIMAL(10) NOT NULL,
parent_id DECIMAL(10) NOT NULL
);
CREATE TABLE m_project_tbl (
id DECIMAL(10) NOT NULL,
name VARCHAR(128) DEFAULT '',
status DECIMAL(5) DEFAULT 10 NOT NULL,
enabled DECIMAL(1) DEFAULT 1 NOT NULL,
view_state DECIMAL(5) DEFAULT 10 NOT NULL,
access_min DECIMAL(5) DEFAULT 10 NOT NULL,
file_path VARCHAR(250) DEFAULT '',
description VARCHAR(4000) NOT NULL,
PRIMARY KEY (id)
);
CREATE SEQUENCE SEQ_m_project_tbl ;
CREATE OR REPLACE TRIGGER TRIG_SEQ_m_project_tbl BEFORE insert ON m_project_tbl FOR EACH ROW WHEN (NEW.id IS NULL OR NEW.id = 0) BEGIN select SEQ_m_project_tbl.nextval into :new.id from dual; END;
CREATE INDEX idx_project_id ON m_project_tbl (id);
CREATE UNIQUE INDEX idx_project_name ON m_project_tbl (name);
CREATE INDEX idx_project_view ON m_project_tbl (view_state);
CREATE TABLE m_project_user_list_tbl (
project_id DECIMAL(10) DEFAULT 0 NOT NULL,
user_id DECIMAL(10) DEFAULT 0 NOT NULL,
access_level DECIMAL(5) DEFAULT 10 NOT NULL,
PRIMARY KEY (project_id, user_id)
);
CREATE INDEX idx_project_user ON m_project_user_list_tbl (user_id);
CREATE TABLE m_project_version_tbl (
id DECIMAL(10) NOT NULL,
project_id DECIMAL(10) DEFAULT 0 NOT NULL,
version VARCHAR(64) DEFAULT '',
date_order DATE DEFAULT '01-01-1970' NOT NULL,
description VARCHAR(4000) NOT NULL,
released DECIMAL(1) DEFAULT 1 NOT NULL,
PRIMARY KEY (id)
);
CREATE SEQUENCE SEQ_m_project_version_tbl ;
CREATE OR REPLACE TRIGGER TRIG_SEQ_m_project_version_tbl BEFORE insert ON m_project_version_tbl FOR EACH ROW WHEN (NEW.id IS NULL OR NEW.id = 0) BEGIN select SEQ_m_project_version_tbl.nextval into :new.id from dual; END;
CREATE UNIQUE INDEX idx_project_version ON m_project_version_tbl (project_id, version);
CREATE TABLE m_sponsorship_tbl (
id DECIMAL(10) NOT NULL,
bug_id DECIMAL(10) DEFAULT 0 NOT NULL,
user_id DECIMAL(10) DEFAULT 0 NOT NULL,
amount DECIMAL(10) DEFAULT 0 NOT NULL,
logo VARCHAR(128) DEFAULT '',
url VARCHAR(128) DEFAULT '',
paid DECIMAL(1) DEFAULT 0 NOT NULL,
date_submitted DATE DEFAULT '01-01-1970' NOT NULL,
last_updated DATE DEFAULT '01-01-1970' NOT NULL,
PRIMARY KEY (id)
);
CREATE SEQUENCE SEQ_m_sponsorship_tbl ;
CREATE OR REPLACE TRIGGER TRIG_SEQ_m_sponsorship_tbl BEFORE insert ON m_sponsorship_tbl FOR EACH ROW WHEN (NEW.id IS NULL OR NEW.id = 0) BEGIN select SEQ_m_sponsorship_tbl.nextval into :new.id from dual; END;
CREATE INDEX idx_sponsorship_bug_id ON m_sponsorship_tbl (bug_id);
CREATE INDEX idx_sponsorship_user_id ON m_sponsorship_tbl (user_id);
CREATE TABLE m_tokens_tbl (
id DECIMAL(10) NOT NULL,
owner DECIMAL(10) NOT NULL,
type DECIMAL(10) NOT NULL,
timestamp DATE NOT NULL,
expiry DATE,
value VARCHAR(4000) NOT NULL,
PRIMARY KEY (id)
);
CREATE SEQUENCE SEQ_m_tokens_tbl ;
CREATE OR REPLACE TRIGGER TRIG_SEQ_m_tokens_tbl BEFORE insert ON m_tokens_tbl FOR EACH ROW WHEN (NEW.id IS NULL OR NEW.id = 0) BEGIN select SEQ_m_tokens_tbl.nextval into :new.id from dual; END;
CREATE TABLE m_user_pref_tbl (
id DECIMAL(10) NOT NULL,
user_id DECIMAL(10) DEFAULT 0 NOT NULL,
project_id DECIMAL(10) DEFAULT 0 NOT NULL,
default_profile DECIMAL(10) DEFAULT 0 NOT NULL,
default_project DECIMAL(10) DEFAULT 0 NOT NULL,
advanced_report DECIMAL(1) DEFAULT 0 NOT NULL,
advanced_view DECIMAL(1) DEFAULT 0 NOT NULL,
advanced_update DECIMAL(1) DEFAULT 0 NOT NULL,
refresh_delay DECIMAL(10) DEFAULT 0 NOT NULL,
redirect_delay DECIMAL(1) DEFAULT 0 NOT NULL,
bugnote_order VARCHAR(4) DEFAULT 'ASC' NOT NULL,
email_on_new DECIMAL(1) DEFAULT 0 NOT NULL,
email_on_assigned DECIMAL(1) DEFAULT 0 NOT NULL,
email_on_feedback DECIMAL(1) DEFAULT 0 NOT NULL,
email_on_resolved DECIMAL(1) DEFAULT 0 NOT NULL,
email_on_closed DECIMAL(1) DEFAULT 0 NOT NULL,
email_on_reopened DECIMAL(1) DEFAULT 0 NOT NULL,
email_on_bugnote DECIMAL(1) DEFAULT 0 NOT NULL,
email_on_status DECIMAL(1) DEFAULT 0 NOT NULL,
email_on_priority DECIMAL(1) DEFAULT 0 NOT NULL,
email_on_priority_min_severity DECIMAL(5) DEFAULT 10 NOT NULL,
email_on_status_min_severity DECIMAL(5) DEFAULT 10 NOT NULL,
email_on_bugnote_min_severity DECIMAL(5) DEFAULT 10 NOT NULL,
email_on_reopened_min_severity DECIMAL(5) DEFAULT 10 NOT NULL,
email_on_closed_min_severity DECIMAL(5) DEFAULT 10 NOT NULL,
email_on_resolved_min_severity DECIMAL(5) DEFAULT 10 NOT NULL,
email_on_feedback_min_severity DECIMAL(5) DEFAULT 10 NOT NULL,
email_on_assigned_min_severity DECIMAL(5) DEFAULT 10 NOT NULL,
email_on_new_min_severity DECIMAL(5) DEFAULT 10 NOT NULL,
email_bugnote_limit DECIMAL(5) DEFAULT 0 NOT NULL,
language VARCHAR(32) DEFAULT 'english' NOT NULL,
PRIMARY KEY (id)
);
CREATE SEQUENCE SEQ_m_user_pref_tbl ;
CREATE OR REPLACE TRIGGER TRIG_SEQ_m_user_pref_tbl BEFORE insert ON m_user_pref_tbl FOR EACH ROW WHEN (NEW.id IS NULL OR NEW.id = 0) BEGIN select SEQ_m_user_pref_tbl.nextval into :new.id from dual; END;
CREATE TABLE m_user_print_pref_tbl (
user_id DECIMAL(10) DEFAULT 0 NOT NULL,
print_pref VARCHAR(27) DEFAULT '',
PRIMARY KEY (user_id)
);
CREATE TABLE m_user_profile_tbl (
id DECIMAL(10) NOT NULL,
user_id DECIMAL(10) DEFAULT 0 NOT NULL,
platform VARCHAR(32) DEFAULT '',
os VARCHAR(32) DEFAULT '',
os_build VARCHAR(32) DEFAULT '',
description VARCHAR(4000) NOT NULL,
PRIMARY KEY (id)
);
CREATE SEQUENCE SEQ_m_user_profile_tbl ;
CREATE OR REPLACE TRIGGER TRIG_SEQ_m_user_profile_tbl BEFORE insert ON m_user_profile_tbl FOR EACH ROW WHEN (NEW.id IS NULL OR NEW.id = 0) BEGIN select SEQ_m_user_profile_tbl.nextval into :new.id from dual; END;
CREATE TABLE m_user_tbl (
id DECIMAL(10) NOT NULL,
username VARCHAR(32) DEFAULT '',
realname VARCHAR(64) DEFAULT '',
email VARCHAR(64) DEFAULT '',
password VARCHAR(32) DEFAULT '',
date_created DATE DEFAULT '01-01-1970' NOT NULL,
last_visit DATE DEFAULT '01-01-1970' NOT NULL,
enabled DECIMAL(1) DEFAULT 1 NOT NULL,
protected DECIMAL(1) DEFAULT 0 NOT NULL,
access_level DECIMAL(5) DEFAULT 10 NOT NULL,
login_count DECIMAL(10) DEFAULT 0 NOT NULL,
lost_password_request_count DECIMAL(5) DEFAULT 0 NOT NULL,
failed_login_count DECIMAL(5) DEFAULT 0 NOT NULL,
cookie_string VARCHAR(64) DEFAULT '',
PRIMARY KEY (id)
);
CREATE SEQUENCE SEQ_m_user_tbl ;
CREATE OR REPLACE TRIGGER TRIG_SEQ_m_user_tbl BEFORE insert ON m_user_tbl FOR EACH ROW WHEN (NEW.id IS NULL OR NEW.id = 0) BEGIN select SEQ_m_user_tbl.nextval into :new.id from dual; END;
CREATE UNIQUE INDEX idx_user_cookie_string ON m_user_tbl (cookie_string);
CREATE UNIQUE INDEX idx_user_username ON m_user_tbl (username);
CREATE INDEX idx_enable ON m_user_tbl (enabled);
CREATE INDEX idx_access ON m_user_tbl (access_level);
INSERT INTO m_user_tbl(username, realname, email, password, date_created, last_visit, enabled, protected, access_level, login_count, lost_password_request_count, failed_login_count, cookie_string) VALUES
('administrator', '', 'root@localhost', '63a9f0ea7bb98050796b649e85481845', TO_DATE('2006-03-14, 03:34:57 PM','RRRR-MM-DD, HH:MI:SS AM'), TO_DATE('2006-03-14, 03:34:57 PM','RRRR-MM-DD, HH:MI:SS AM'), 1, 0, 90, 3, 0, 0, '5ad703c9d41f93d323d7aff3172753b3b28d7307204eed0056492e9d916f5fb3');
INSERT INTO m_config_tbl ( value, type, access_reqd, config_id, project_id, user_id ) VALUES ('51', 1, 90, 'database_version', 20, 0 ); |
Partager