Index: trunk/phase3/maintenance/ibm_db2/tables.sql |
— | — | @@ -8,14 +8,14 @@ |
9 | 9 | |
10 | 10 | |
11 | 11 | CREATE TABLE user ( |
12 | | - user_id INTEGER PRIMARY KEY GENERATED BY DEFAULT AS IDENTITY (START WITH 0), |
| 12 | + user_id BIGINT PRIMARY KEY GENERATED BY DEFAULT AS IDENTITY (START WITH 0), |
13 | 13 | user_name VARCHAR(255) NOT NULL UNIQUE, |
14 | 14 | user_real_name VARCHAR(255), |
15 | 15 | user_password VARCHAR(1024), |
16 | 16 | user_newpassword VARCHAR(1024), |
17 | 17 | user_newpass_time TIMESTAMP(3), |
18 | 18 | user_token VARCHAR(255), |
19 | | - user_email VARCHAR(255), |
| 19 | + user_email VARCHAR(1024), |
20 | 20 | user_email_token VARCHAR(255), |
21 | 21 | user_email_token_expires TIMESTAMP(3), |
22 | 22 | user_email_authenticated TIMESTAMP(3), |
— | — | @@ -43,7 +43,7 @@ |
44 | 44 | |
45 | 45 | |
46 | 46 | CREATE TABLE user_groups ( |
47 | | - ug_user INTEGER NOT NULL DEFAULT 0, |
| 47 | + ug_user BIGINT NOT NULL DEFAULT 0, |
48 | 48 | -- REFERENCES user(user_id) ON DELETE CASCADE, |
49 | 49 | ug_group VARCHAR(255) NOT NULL |
50 | 50 | ); |
— | — | @@ -56,7 +56,7 @@ |
57 | 57 | |
58 | 58 | CREATE TABLE user_newtalk ( |
59 | 59 | -- registered users key |
60 | | - user_id INTEGER NOT NULL DEFAULT 0, |
| 60 | + user_id BIGINT NOT NULL DEFAULT 0, |
61 | 61 | -- REFERENCES user(user_id) ON DELETE CASCADE, |
62 | 62 | -- anonymous users key |
63 | 63 | user_ip VARCHAR(40), |
— | — | @@ -71,7 +71,7 @@ |
72 | 72 | |
73 | 73 | |
74 | 74 | CREATE TABLE page ( |
75 | | - page_id INTEGER PRIMARY KEY GENERATED BY DEFAULT AS IDENTITY (START WITH 0), |
| 75 | + page_id BIGINT PRIMARY KEY GENERATED BY DEFAULT AS IDENTITY (START WITH 0), |
76 | 76 | page_namespace SMALLINT NOT NULL, |
77 | 77 | page_title VARCHAR(255) NOT NULL, |
78 | 78 | page_restrictions VARCHAR(1024), |
— | — | @@ -80,8 +80,8 @@ |
81 | 81 | page_is_new SMALLINT NOT NULL DEFAULT 0, |
82 | 82 | page_random NUMERIC(15,14) NOT NULL, |
83 | 83 | page_touched TIMESTAMP(3), |
84 | | - page_latest INTEGER NOT NULL, -- FK? |
85 | | - page_len INTEGER NOT NULL |
| 84 | + page_latest BIGINT NOT NULL, -- FK? |
| 85 | + page_len BIGINT NOT NULL |
86 | 86 | ); |
87 | 87 | CREATE UNIQUE INDEX page_unique_name ON page (page_namespace, page_title); |
88 | 88 | CREATE INDEX page_random_idx ON page (page_random); |
— | — | @@ -96,19 +96,19 @@ |
97 | 97 | |
98 | 98 | |
99 | 99 | CREATE TABLE revision ( |
100 | | - rev_id INTEGER PRIMARY KEY GENERATED BY DEFAULT AS IDENTITY (START WITH 0), |
101 | | - rev_page INTEGER NOT NULL DEFAULT 0, |
| 100 | + rev_id BIGINT PRIMARY KEY GENERATED BY DEFAULT AS IDENTITY (START WITH 0), |
| 101 | + rev_page BIGINT NOT NULL DEFAULT 0, |
102 | 102 | -- REFERENCES page (page_id) ON DELETE CASCADE, |
103 | | - rev_text_id INTEGER, -- FK |
104 | | - rev_comment VARCHAR(1024), |
105 | | - rev_user INTEGER NOT NULL DEFAULT 0, |
| 103 | + rev_text_id BIGINT, -- FK |
| 104 | + rev_comment VARCHAR(1024), |
| 105 | + rev_user BIGINT NOT NULL DEFAULT 0, |
106 | 106 | -- REFERENCES user(user_id) ON DELETE RESTRICT, |
107 | | - rev_user_text VARCHAR(255) NOT NULL, |
108 | | - rev_timestamp TIMESTAMP(3) NOT NULL, |
109 | | - rev_minor_edit SMALLINT NOT NULL DEFAULT 0, |
110 | | - rev_deleted SMALLINT NOT NULL DEFAULT 0, |
111 | | - rev_len INTEGER, |
112 | | - rev_parent_id INTEGER |
| 107 | + rev_user_text VARCHAR(255) NOT NULL, |
| 108 | + rev_timestamp TIMESTAMP(3) NOT NULL, |
| 109 | + rev_minor_edit SMALLINT NOT NULL DEFAULT 0, |
| 110 | + rev_deleted SMALLINT NOT NULL DEFAULT 0, |
| 111 | + rev_len BIGINT, |
| 112 | + rev_parent_id BIGINT DEFAULT NULL |
113 | 113 | ); |
114 | 114 | CREATE UNIQUE INDEX revision_unique ON revision (rev_page, rev_id); |
115 | 115 | CREATE INDEX rev_text_id_idx ON revision (rev_text_id); |
— | — | @@ -130,7 +130,7 @@ |
131 | 131 | CREATE TABLE page_restrictions ( |
132 | 132 | --pr_id INTEGER NOT NULL UNIQUE, --DEFAULT nextval('pr_id_val'), |
133 | 133 | --pr_id INTEGER PRIMARY KEY GENERATED BY DEFAULT AS IDENTITY (START WITH 0), |
134 | | - pr_id INTEGER PRIMARY KEY GENERATED BY DEFAULT AS IDENTITY (START WITH 0), |
| 134 | + pr_id BIGINT PRIMARY KEY GENERATED BY DEFAULT AS IDENTITY (START WITH 0), |
135 | 135 | pr_page INTEGER NOT NULL DEFAULT 0, |
136 | 136 | --(used to be nullable) |
137 | 137 | -- REFERENCES page (page_id) ON DELETE CASCADE, |
— | — | @@ -164,7 +164,7 @@ |
165 | 165 | ar_title VARCHAR(255) NOT NULL, |
166 | 166 | ar_text CLOB(16M) INLINE LENGTH 4096, |
167 | 167 | ar_comment VARCHAR(1024), |
168 | | - ar_user INTEGER NOT NULL, |
| 168 | + ar_user BIGINT NOT NULL, |
169 | 169 | -- no foreign keys in MySQL |
170 | 170 | -- REFERENCES user(user_id) ON DELETE SET NULL, |
171 | 171 | ar_user_text VARCHAR(255) NOT NULL, |
— | — | @@ -184,7 +184,7 @@ |
185 | 185 | |
186 | 186 | |
187 | 187 | CREATE TABLE redirect ( |
188 | | - rd_from INTEGER NOT NULL PRIMARY KEY, |
| 188 | + rd_from BIGINT NOT NULL PRIMARY KEY, |
189 | 189 | --REFERENCES page(page_id) ON DELETE CASCADE, |
190 | 190 | rd_namespace SMALLINT NOT NULL DEFAULT 0, |
191 | 191 | rd_title VARCHAR(255) NOT NULL DEFAULT '', |
— | — | @@ -195,7 +195,7 @@ |
196 | 196 | |
197 | 197 | |
198 | 198 | CREATE TABLE pagelinks ( |
199 | | - pl_from INTEGER NOT NULL DEFAULT 0, |
| 199 | + pl_from BIGINT NOT NULL DEFAULT 0, |
200 | 200 | -- REFERENCES page(page_id) ON DELETE CASCADE, |
201 | 201 | pl_namespace SMALLINT NOT NULL, |
202 | 202 | pl_title VARCHAR(255) NOT NULL |
— | — | @@ -203,7 +203,7 @@ |
204 | 204 | CREATE UNIQUE INDEX pagelink_unique ON pagelinks (pl_from,pl_namespace,pl_title); |
205 | 205 | |
206 | 206 | CREATE TABLE templatelinks ( |
207 | | - tl_from INTEGER NOT NULL DEFAULT 0, |
| 207 | + tl_from BIGINT NOT NULL DEFAULT 0, |
208 | 208 | -- REFERENCES page(page_id) ON DELETE CASCADE, |
209 | 209 | tl_namespace SMALLINT NOT NULL, |
210 | 210 | tl_title VARCHAR(255) NOT NULL |
— | — | @@ -212,7 +212,7 @@ |
213 | 213 | CREATE UNIQUE INDEX tl_from_idx ON templatelinks (tl_from,tl_namespace,tl_title); |
214 | 214 | |
215 | 215 | CREATE TABLE imagelinks ( |
216 | | - il_from INTEGER NOT NULL DEFAULT 0, |
| 216 | + il_from BIGINT NOT NULL DEFAULT 0, |
217 | 217 | -- REFERENCES page(page_id) ON DELETE CASCADE, |
218 | 218 | il_to VARCHAR(255) NOT NULL |
219 | 219 | ); |
— | — | @@ -220,10 +220,12 @@ |
221 | 221 | CREATE UNIQUE INDEX il_to_idx ON imagelinks (il_from,il_to); |
222 | 222 | |
223 | 223 | CREATE TABLE categorylinks ( |
224 | | - cl_from INTEGER NOT NULL DEFAULT 0, |
| 224 | + cl_from BIGINT NOT NULL DEFAULT 0, |
225 | 225 | -- REFERENCES page(page_id) ON DELETE CASCADE, |
226 | 226 | cl_to VARCHAR(255) NOT NULL, |
227 | | - cl_sortkey VARCHAR(70), |
| 227 | + -- cl_sortkey has to be at least 86 wide |
| 228 | + -- in order to be compatible with the old MySQL schema from MW 1.10 |
| 229 | + cl_sortkey VARCHAR(86), |
228 | 230 | cl_timestamp TIMESTAMP(3) NOT NULL |
229 | 231 | ); |
230 | 232 | CREATE UNIQUE INDEX cl_from ON categorylinks (cl_from, cl_to); |
— | — | @@ -232,7 +234,7 @@ |
233 | 235 | |
234 | 236 | |
235 | 237 | CREATE TABLE externallinks ( |
236 | | - el_from INTEGER NOT NULL DEFAULT 0, |
| 238 | + el_from BIGINT NOT NULL DEFAULT 0, |
237 | 239 | -- REFERENCES page(page_id) ON DELETE CASCADE, |
238 | 240 | el_to VARCHAR(1024) NOT NULL, |
239 | 241 | el_index VARCHAR(1024) NOT NULL |
— | — | @@ -246,7 +248,7 @@ |
247 | 249 | -- |
248 | 250 | CREATE TABLE external_user ( |
249 | 251 | -- Foreign key to user_id |
250 | | - eu_wiki_id INTEGER NOT NULL PRIMARY KEY, |
| 252 | + eu_wiki_id BIGINT NOT NULL PRIMARY KEY, |
251 | 253 | |
252 | 254 | -- Some opaque identifier provided by the external database |
253 | 255 | eu_external_id VARCHAR(255) NOT NULL |
— | — | @@ -261,7 +263,7 @@ |
262 | 264 | |
263 | 265 | |
264 | 266 | CREATE TABLE langlinks ( |
265 | | - ll_from INTEGER NOT NULL DEFAULT 0, |
| 267 | + ll_from BIGINT NOT NULL DEFAULT 0, |
266 | 268 | -- REFERENCES page (page_id) ON DELETE CASCADE, |
267 | 269 | ll_lang VARCHAR(20), |
268 | 270 | ll_title VARCHAR(255) |
— | — | @@ -271,10 +273,10 @@ |
272 | 274 | |
273 | 275 | |
274 | 276 | CREATE TABLE site_stats ( |
275 | | - ss_row_id INTEGER NOT NULL UNIQUE, |
276 | | - ss_total_views INTEGER DEFAULT 0, |
277 | | - ss_total_edits INTEGER DEFAULT 0, |
278 | | - ss_good_articles INTEGER DEFAULT 0, |
| 277 | + ss_row_id BIGINT NOT NULL UNIQUE, |
| 278 | + ss_total_views BIGINT DEFAULT 0, |
| 279 | + ss_total_edits BIGINT DEFAULT 0, |
| 280 | + ss_good_articles BIGINT DEFAULT 0, |
279 | 281 | ss_total_pages INTEGER DEFAULT -1, |
280 | 282 | ss_users INTEGER DEFAULT -1, |
281 | 283 | ss_active_users INTEGER DEFAULT -1, |
— | — | @@ -290,9 +292,9 @@ |
291 | 293 | ipb_id INTEGER NOT NULL PRIMARY KEY, |
292 | 294 | --DEFAULT nextval('ipblocks_ipb_id_val'), |
293 | 295 | ipb_address VARCHAR(1024), |
294 | | - ipb_user INTEGER NOT NULL DEFAULT 0, |
| 296 | + ipb_user BIGINT NOT NULL DEFAULT 0, |
295 | 297 | -- REFERENCES user(user_id) ON DELETE SET NULL, |
296 | | - ipb_by INTEGER NOT NULL DEFAULT 0, |
| 298 | + ipb_by BIGINT NOT NULL DEFAULT 0, |
297 | 299 | -- REFERENCES user(user_id) ON DELETE CASCADE, |
298 | 300 | ipb_by_text VARCHAR(255) NOT NULL DEFAULT '', |
299 | 301 | ipb_reason VARCHAR(1024) NOT NULL, |
— | — | @@ -317,7 +319,7 @@ |
318 | 320 | |
319 | 321 | CREATE TABLE image ( |
320 | 322 | img_name VARCHAR(255) NOT NULL PRIMARY KEY, |
321 | | - img_size INTEGER NOT NULL, |
| 323 | + img_size BIGINT NOT NULL, |
322 | 324 | img_width INTEGER NOT NULL, |
323 | 325 | img_height INTEGER NOT NULL, |
324 | 326 | img_metadata CLOB(16M) INLINE LENGTH 4096 NOT NULL DEFAULT '', |
— | — | @@ -326,7 +328,7 @@ |
327 | 329 | img_major_mime VARCHAR(255) DEFAULT 'unknown', |
328 | 330 | img_minor_mime VARCHAR(32) DEFAULT 'unknown', |
329 | 331 | img_description VARCHAR(1024) NOT NULL DEFAULT '', |
330 | | - img_user INTEGER NOT NULL DEFAULT 0, |
| 332 | + img_user BIGINT NOT NULL DEFAULT 0, |
331 | 333 | -- REFERENCES user(user_id) ON DELETE SET NULL, |
332 | 334 | img_user_text VARCHAR(255) NOT NULL DEFAULT '', |
333 | 335 | img_timestamp TIMESTAMP(3), |
— | — | @@ -339,12 +341,12 @@ |
340 | 342 | CREATE TABLE oldimage ( |
341 | 343 | oi_name VARCHAR(255) NOT NULL DEFAULT '', |
342 | 344 | oi_archive_name VARCHAR(255) NOT NULL, |
343 | | - oi_size INTEGER NOT NULL, |
| 345 | + oi_size BIGINT NOT NULL, |
344 | 346 | oi_width INTEGER NOT NULL, |
345 | 347 | oi_height INTEGER NOT NULL, |
346 | 348 | oi_bits SMALLINT NOT NULL, |
347 | 349 | oi_description VARCHAR(1024), |
348 | | - oi_user INTEGER NOT NULL DEFAULT 0, |
| 350 | + oi_user BIGINT NOT NULL DEFAULT 0, |
349 | 351 | -- REFERENCES user(user_id) ON DELETE SET NULL, |
350 | 352 | oi_user_text VARCHAR(255) NOT NULL, |
351 | 353 | oi_timestamp TIMESTAMP(3) NOT NULL, |
— | — | @@ -369,12 +371,12 @@ |
370 | 372 | fa_name VARCHAR(255) NOT NULL, |
371 | 373 | fa_archive_name VARCHAR(255), |
372 | 374 | fa_storage_group VARCHAR(255), |
373 | | - fa_storage_key VARCHAR(32), |
374 | | - fa_deleted_user INTEGER NOT NULL DEFAULT 0, |
| 375 | + fa_storage_key VARCHAR(64) DEFAULT '', |
| 376 | + fa_deleted_user BIGINT NOT NULL DEFAULT 0, |
375 | 377 | -- REFERENCES user(user_id) ON DELETE SET NULL, |
376 | 378 | fa_deleted_timestamp TIMESTAMP(3) NOT NULL, |
377 | 379 | fa_deleted_reason VARCHAR(255), |
378 | | - fa_size INTEGER NOT NULL, |
| 380 | + fa_size BIGINT NOT NULL, |
379 | 381 | fa_width INTEGER NOT NULL, |
380 | 382 | fa_height INTEGER NOT NULL, |
381 | 383 | fa_metadata CLOB(16M) INLINE LENGTH 4096 NOT NULL DEFAULT '', |
— | — | @@ -383,7 +385,7 @@ |
384 | 386 | fa_major_mime VARCHAR(255) DEFAULT 'unknown', |
385 | 387 | fa_minor_mime VARCHAR(255) DEFAULT 'unknown', |
386 | 388 | fa_description VARCHAR(1024) NOT NULL, |
387 | | - fa_user INTEGER NOT NULL DEFAULT 0, |
| 389 | + fa_user BIGINT NOT NULL DEFAULT 0, |
388 | 390 | -- REFERENCES user(user_id) ON DELETE SET NULL, |
389 | 391 | fa_user_text VARCHAR(255) NOT NULL, |
390 | 392 | fa_timestamp TIMESTAMP(3), |
— | — | @@ -400,7 +402,7 @@ |
401 | 403 | --PRIMARY KEY DEFAULT nextval('rc_rc_id_seq'), |
402 | 404 | rc_timestamp TIMESTAMP(3) NOT NULL, |
403 | 405 | rc_cur_time TIMESTAMP(3) NOT NULL, |
404 | | - rc_user INTEGER NOT NULL DEFAULT 0, |
| 406 | + rc_user BIGINT NOT NULL DEFAULT 0, |
405 | 407 | -- REFERENCES user(user_id) ON DELETE SET NULL, |
406 | 408 | rc_user_text VARCHAR(255) NOT NULL, |
407 | 409 | rc_namespace SMALLINT NOT NULL, |
— | — | @@ -409,10 +411,10 @@ |
410 | 412 | rc_minor SMALLINT NOT NULL DEFAULT 0, |
411 | 413 | rc_bot SMALLINT NOT NULL DEFAULT 0, |
412 | 414 | rc_new SMALLINT NOT NULL DEFAULT 0, |
413 | | - rc_cur_id INTEGER NOT NULL DEFAULT 0, |
| 415 | + rc_cur_id BIGINT NOT NULL DEFAULT 0, |
414 | 416 | -- REFERENCES page(page_id) ON DELETE SET NULL, |
415 | | - rc_this_oldid INTEGER NOT NULL, |
416 | | - rc_last_oldid INTEGER NOT NULL, |
| 417 | + rc_this_oldid BIGINT NOT NULL, |
| 418 | + rc_last_oldid BIGINT NOT NULL, |
417 | 419 | rc_type SMALLINT NOT NULL DEFAULT 0, |
418 | 420 | rc_moved_to_ns SMALLINT, |
419 | 421 | rc_moved_to_title VARCHAR(255), |
— | — | @@ -421,7 +423,7 @@ |
422 | 424 | rc_old_len INTEGER, |
423 | 425 | rc_new_len INTEGER, |
424 | 426 | rc_deleted SMALLINT NOT NULL DEFAULT 0, |
425 | | - rc_logid INTEGER NOT NULL DEFAULT 0, |
| 427 | + rc_logid BIGINT NOT NULL DEFAULT 0, |
426 | 428 | rc_log_type VARCHAR(255), |
427 | 429 | rc_log_action VARCHAR(255), |
428 | 430 | rc_params CLOB(64K) INLINE LENGTH 4096 |
— | — | @@ -436,7 +438,7 @@ |
437 | 439 | |
438 | 440 | |
439 | 441 | CREATE TABLE watchlist ( |
440 | | - wl_user INTEGER NOT NULL DEFAULT 0, |
| 442 | + wl_user BIGINT NOT NULL DEFAULT 0, |
441 | 443 | -- REFERENCES user(user_id) ON DELETE CASCADE, |
442 | 444 | wl_namespace SMALLINT NOT NULL DEFAULT 0, |
443 | 445 | wl_title VARCHAR(255) NOT NULL, |
— | — | @@ -464,8 +466,8 @@ |
465 | 467 | |
466 | 468 | CREATE TABLE querycache ( |
467 | 469 | qc_type VARCHAR(255) NOT NULL, |
468 | | - qc_value INTEGER NOT NULL, |
469 | | - qc_namespace SMALLINT NOT NULL, |
| 470 | + qc_value BIGINT NOT NULL, |
| 471 | + qc_namespace INTEGER NOT NULL, |
470 | 472 | qc_title VARCHAR(255) NOT NULL |
471 | 473 | ); |
472 | 474 | CREATE INDEX querycache_type_value ON querycache (qc_type, qc_value); |
— | — | @@ -480,7 +482,7 @@ |
481 | 483 | |
482 | 484 | CREATE TABLE querycachetwo ( |
483 | 485 | qcc_type VARCHAR(255) NOT NULL, |
484 | | - qcc_value INTEGER NOT NULL DEFAULT 0, |
| 486 | + qcc_value BIGINT NOT NULL DEFAULT 0, |
485 | 487 | qcc_namespace INTEGER NOT NULL DEFAULT 0, |
486 | 488 | qcc_title VARCHAR(255) NOT NULL DEFAULT '', |
487 | 489 | qcc_namespacetwo INTEGER NOT NULL DEFAULT 0, |
— | — | @@ -501,24 +503,24 @@ |
502 | 504 | |
503 | 505 | CREATE TABLE transcache ( |
504 | 506 | tc_url VARCHAR(255) NOT NULL UNIQUE, |
505 | | - tc_contents VARCHAR(255) NOT NULL, |
| 507 | + tc_contents CLOB(64K) INLINE LENGTH 4096 NOT NULL, |
506 | 508 | tc_time TIMESTAMP(3) NOT NULL |
507 | 509 | ); |
508 | 510 | |
509 | 511 | |
510 | 512 | CREATE TABLE logging ( |
511 | | - log_id INTEGER NOT NULL PRIMARY KEY, |
| 513 | + log_id BIGINT NOT NULL PRIMARY KEY, |
512 | 514 | --PRIMARY KEY DEFAULT nextval('log_log_id_seq'), |
513 | 515 | log_type VARCHAR(32) NOT NULL, |
514 | 516 | log_action VARCHAR(32) NOT NULL, |
515 | 517 | log_timestamp TIMESTAMP(3) NOT NULL, |
516 | | - log_user INTEGER NOT NULL DEFAULT 0, |
| 518 | + log_user BIGINT NOT NULL DEFAULT 0, |
517 | 519 | -- REFERENCES user(user_id) ON DELETE SET NULL, |
518 | 520 | -- Name of the user who performed this action |
519 | 521 | log_user_text VARCHAR(255) NOT NULL default '', |
520 | 522 | log_namespace SMALLINT NOT NULL, |
521 | 523 | log_title VARCHAR(255) NOT NULL, |
522 | | - log_page INTEGER, |
| 524 | + log_page BIGINT, |
523 | 525 | log_comment VARCHAR(255), |
524 | 526 | log_params CLOB(64K) INLINE LENGTH 4096, |
525 | 527 | log_deleted SMALLINT NOT NULL DEFAULT 0 |
— | — | @@ -546,7 +548,7 @@ |
547 | 549 | |
548 | 550 | |
549 | 551 | CREATE TABLE job ( |
550 | | - job_id INTEGER NOT NULL PRIMARY KEY, |
| 552 | + job_id BIGINT NOT NULL PRIMARY KEY, |
551 | 553 | --PRIMARY KEY DEFAULT nextval('job_job_id_seq'), |
552 | 554 | job_cmd VARCHAR(255) NOT NULL, |
553 | 555 | job_namespace SMALLINT NOT NULL, |
— | — | @@ -607,7 +609,7 @@ |
608 | 610 | -- hack implementation |
609 | 611 | -- should be replaced with OmniFind, Contains(), etc |
610 | 612 | CREATE TABLE searchindex ( |
611 | | - si_page int NOT NULL, |
| 613 | + si_page BIGINT NOT NULL, |
612 | 614 | si_title varchar(255) NOT NULL default '', |
613 | 615 | si_text clob NOT NULL |
614 | 616 | ); |
— | — | @@ -623,9 +625,9 @@ |
624 | 626 | CREATE UNIQUE INDEX pf_name_server ON profiling (pf_name, pf_server); |
625 | 627 | |
626 | 628 | CREATE TABLE protected_titles ( |
627 | | - pt_namespace SMALLINT NOT NULL, |
| 629 | + pt_namespace INTEGER NOT NULL, |
628 | 630 | pt_title VARCHAR(255) NOT NULL, |
629 | | - pt_user INTEGER NOT NULL DEFAULT 0, |
| 631 | + pt_user BIGINT NOT NULL DEFAULT 0, |
630 | 632 | -- REFERENCES user(user_id) ON DELETE SET NULL, |
631 | 633 | pt_reason VARCHAR(1024), |
632 | 634 | pt_timestamp TIMESTAMP(3) NOT NULL, |
— | — | @@ -697,7 +699,7 @@ |
698 | 700 | -- |
699 | 701 | CREATE TABLE user_properties ( |
700 | 702 | -- Foreign key to user.user_id |
701 | | - up_user INTEGER NOT NULL, |
| 703 | + up_user BIGINT NOT NULL, |
702 | 704 | |
703 | 705 | -- Name of the option being saved. This is indexed for bulk lookup. |
704 | 706 | up_property VARCHAR(32) FOR BIT DATA NOT NULL, |
— | — | @@ -714,7 +716,7 @@ |
715 | 717 | -- The value of the ID |
716 | 718 | ls_value varchar(255) NOT NULL, |
717 | 719 | -- Key to log_id |
718 | | - ls_log_id INTEGER NOT NULL default 0 |
| 720 | + ls_log_id BIGINT NOT NULL default 0 |
719 | 721 | ); |
720 | 722 | CREATE UNIQUE INDEX ls_field_val ON log_search (ls_field,ls_value,ls_log_id); |
721 | 723 | CREATE INDEX ls_log_id ON log_search (ls_log_id); |
Index: trunk/phase3/includes/db/DatabaseIbm_db2.php |
— | — | @@ -85,13 +85,18 @@ |
86 | 86 | class IBM_DB2Blob { |
87 | 87 | private $mData; |
88 | 88 | |
89 | | - function __construct($data) { |
| 89 | + public function __construct($data) { |
90 | 90 | $this->mData = $data; |
91 | 91 | } |
92 | 92 | |
93 | | - function getData() { |
| 93 | + public function getData() { |
94 | 94 | return $this->mData; |
95 | 95 | } |
| 96 | + |
| 97 | + public function __toString() |
| 98 | + { |
| 99 | + return $this->mData; |
| 100 | + } |
96 | 101 | } |
97 | 102 | |
98 | 103 | /** |
— | — | @@ -770,6 +775,8 @@ |
771 | 776 | return "NULL"; |
772 | 777 | } else if ($s instanceof Blob) { |
773 | 778 | return "'".$s->fetch($s)."'"; |
| 779 | + } else if ($s instanceof IBM_DB2Blob) { |
| 780 | + return "'".$this->decodeBlob($s)."'"; |
774 | 781 | } |
775 | 782 | $s = $this->strencode($s); |
776 | 783 | if ( is_numeric($s) ) { |