[ Index ]

PHP Cross Reference of MyBB

title

Body

[close]

/install/resources/ -> pgsql_db_tables.php (source)

   1  <?php
   2  /**
   3   * MyBB 1.6
   4   * Copyright 2010 MyBB Group, All Rights Reserved
   5   *
   6   * Website: http://mybb.com
   7   * License: http://mybb.com/about/license
   8   *
   9   * $Id$
  10   */
  11  
  12  // Disallow direct access to this file for security reasons
  13  if(!defined("IN_MYBB"))
  14  {
  15      die("Direct initialization of this file is not allowed.<br /><br />Please make sure IN_MYBB is defined.");
  16  }
  17   
  18  $tables[] = "CREATE TABLE mybb_adminlog (
  19    uid int NOT NULL default '0',
  20    ipaddress varchar(50) NOT NULL default '',
  21    dateline bigint NOT NULL default '0',
  22    module varchar(50) NOT NULL default '',
  23    action varchar(50) NOT NULL default '',
  24    data text NOT NULL default ''
  25  );";
  26  
  27  $tables[] = "CREATE TABLE mybb_adminoptions (
  28    uid int NOT NULL default '0',
  29    cpstyle varchar(50) NOT NULL default '',
  30    codepress int NOT NULL default '1',
  31    notes text NOT NULL default '',
  32    permissions text NOT NULL default '',
  33    defaultviews text NOT NULL,
  34    loginattempts int NOT NULL default '0',
  35    loginlockoutexpiry int NOT NULL default '0',
  36    UNIQUE (uid)
  37  );";
  38  
  39  $tables[] = "CREATE TABLE mybb_adminsessions (
  40      sid varchar(32) NOT NULL default '',
  41      uid int NOT NULL default '0',
  42      loginkey varchar(50) NOT NULL default '',
  43      ip varchar(40) NOT NULL default '',
  44      dateline bigint NOT NULL default '0',
  45      lastactive bigint NOT NULL default '0',
  46      data text NOT NULL default ''
  47  );";
  48  
  49  $tables[] = "CREATE TABLE mybb_adminviews (
  50      vid serial,
  51      uid int NOT NULL default '0',
  52      title varchar(100) NOT NULL default '',
  53      type varchar(6) NOT NULL default '',
  54      visibility int NOT NULL default '0',
  55      fields text NOT NULL,
  56      conditions text NOT NULL,
  57      custom_profile_fields text NOT NULL,
  58      sortby varchar(20) NOT NULL default '',
  59      sortorder varchar(4) NOT NULL default '',
  60      perpage int NOT NULL default '0',
  61      view_type varchar(6) NOT NULL default '',
  62      PRIMARY KEY (vid)
  63  );"; 
  64  
  65  $tables[] = "CREATE TABLE mybb_announcements (
  66    aid serial,
  67    fid int NOT NULL default '0',
  68    uid int NOT NULL default '0',
  69    subject varchar(120) NOT NULL default '',
  70    message text NOT NULL default '',
  71    startdate bigint NOT NULL default '0',
  72    enddate bigint NOT NULL default '0',
  73    allowhtml int NOT NULL default '0',
  74    allowmycode int NOT NULL default '0',
  75    allowsmilies int NOT NULL default '0',
  76    PRIMARY KEY (aid)
  77  );";
  78  
  79  $tables[] = "CREATE TABLE mybb_attachments (
  80    aid serial,
  81    pid int NOT NULL default '0',
  82    posthash varchar(50) NOT NULL default '',
  83    uid int NOT NULL default '0',
  84    filename varchar(120) NOT NULL default '',
  85    filetype varchar(120) NOT NULL default '',
  86    filesize int NOT NULL default '0',
  87    attachname varchar(120) NOT NULL default '',
  88    downloads int NOT NULL default '0',
  89    dateuploaded bigint NOT NULL default '0',
  90    visible int NOT NULL default '0',
  91    thumbnail varchar(120) NOT NULL default '',
  92    PRIMARY KEY (aid)
  93  );";
  94  
  95  $tables[] = "CREATE TABLE mybb_attachtypes (
  96    atid serial,
  97    name varchar(120) NOT NULL default '',
  98    mimetype varchar(120) NOT NULL default '',
  99    extension varchar(10) NOT NULL default '',
 100    maxsize int NOT NULL default '0',
 101    icon varchar(100) NOT NULL default '',
 102    PRIMARY KEY (atid)
 103  );";
 104  
 105  $tables[] = "CREATE TABLE mybb_awaitingactivation (
 106    aid serial,
 107    uid int NOT NULL default '0',
 108    dateline bigint NOT NULL default '0',
 109    code varchar(100) NOT NULL default '',
 110    type char(1) NOT NULL default '',
 111    oldgroup bigint NOT NULL default '0',
 112    misc varchar(255) NOT NULL default '',
 113    PRIMARY KEY (aid)
 114  );";
 115  
 116  $tables[] = "CREATE TABLE mybb_badwords (
 117    bid serial,
 118    badword varchar(100) NOT NULL default '',
 119    replacement varchar(100) NOT NULL default '',
 120    PRIMARY KEY (bid)
 121  );";
 122  
 123  $tables[] = "CREATE TABLE mybb_banfilters (
 124    fid serial,
 125    filter varchar(200) NOT NULL default '',
 126    type int NOT NULL default '0',
 127    lastuse bigint NOT NULL default '0',
 128    dateline bigint NOT NULL default '0',
 129    PRIMARY KEY (fid)
 130  );";
 131  
 132  $tables[] = "CREATE TABLE mybb_banned (
 133    uid int NOT NULL default '0',
 134    gid int NOT NULL default '0',
 135    oldgroup int NOT NULL default '0',
 136    oldadditionalgroups text NOT NULL default '',
 137    olddisplaygroup int NOT NULL default '0',
 138    admin int NOT NULL default '0',
 139    dateline bigint NOT NULL default '0',
 140    bantime varchar(50) NOT NULL default '',
 141    lifted bigint NOT NULL default '0',
 142    reason varchar(255) NOT NULL default ''
 143  );";
 144  
 145  $tables[] = "CREATE TABLE mybb_calendars (
 146    cid serial,
 147    name varchar(100) NOT NULL default '',
 148    disporder int NOT NULL default '0',
 149    startofweek int NOT NULL default '0',
 150    showbirthdays int NOT NULL default '0',
 151    eventlimit int NOT NULL default '0',
 152    moderation int NOT NULL default '0',
 153    allowhtml int NOT NULL default '0',
 154    allowmycode int NOT NULL default '0',
 155    allowimgcode int NOT NULL default '0',
 156    allowvideocode int NOT NULL default '0',
 157    allowsmilies int NOT NULL default '0',
 158    PRIMARY KEY(cid)
 159  );";
 160  
 161  $tables[] = "CREATE TABLE mybb_calendarpermissions (
 162    cid serial,
 163    gid int NOT NULL default '0',
 164    canviewcalendar int NOT NULL default '0',
 165    canaddevents int NOT NULL default '0',
 166    canbypasseventmod int NOT NULL default '0',
 167    canmoderateevents int NOT NULL default '0'
 168  );";
 169  $tables[] = "CREATE TABLE mybb_captcha (
 170    imagehash varchar(32) NOT NULL default '',
 171    imagestring varchar(8) NOT NULL default '',
 172    dateline bigint NOT NULL default '0'
 173  );";
 174  
 175  $tables[] = "CREATE TABLE mybb_datacache (
 176    title varchar(50) NOT NULL default '',
 177    cache text NOT NULL default '',
 178    PRIMARY KEY (title)
 179  );";
 180  
 181  $tables[] = "CREATE TABLE mybb_delayedmoderation (
 182    did serial,
 183    type varchar(30) NOT NULL default '',
 184    delaydateline bigint NOT NULL default '0',
 185    uid int NOT NULL default '0',
 186    fid smallint NOT NULL default '0',
 187    tids text NOT NULL,
 188    dateline bigint NOT NULL default '0',
 189    inputs text NOT NULL default '',
 190    PRIMARY KEY (did)
 191  );";
 192  
 193  $tables[] = "CREATE TABLE mybb_events (
 194    eid serial,
 195    cid int NOT NULL default '0',
 196    uid int NOT NULL default '0',
 197    name varchar(120) NOT NULL default '',
 198    description text NOT NULL,
 199    visible int NOT NULL default '0',
 200    private int NOT NULL default '0',
 201    dateline int NOT NULL default '0',
 202    starttime int NOT NULL default '0',
 203    endtime int  NOT NULL default '0',
 204    timezone varchar(4) NOT NULL default '0',
 205    ignoretimezone int NOT NULL default '0',
 206    usingtime int NOT NULL default '0',
 207    repeats text NOT NULL,
 208    PRIMARY KEY  (eid)
 209  );";
 210  
 211  $tables[] = "CREATE TABLE mybb_forumpermissions (
 212    pid serial,
 213    fid int NOT NULL default '0',
 214    gid int NOT NULL default '0',
 215    canview int NOT NULL default '0',
 216    canviewthreads int NOT NULL default '0',
 217    canonlyviewownthreads int NOT NULL default '0',
 218    candlattachments int NOT NULL default '0',
 219    canpostthreads int NOT NULL default '0',
 220    canpostreplys int NOT NULL default '0',
 221    canpostattachments int NOT NULL default '0',
 222    canratethreads int NOT NULL default '0',
 223    caneditposts int NOT NULL default '0',
 224    candeleteposts int NOT NULL default '0',
 225    candeletethreads int NOT NULL default '0',
 226    caneditattachments int NOT NULL default '0',
 227    canpostpolls int NOT NULL default '0',
 228    canvotepolls int NOT NULL default '0',
 229    cansearch int NOT NULL default '0',
 230    PRIMARY KEY (pid)
 231  );";
 232  
 233  $tables[] = "CREATE TABLE mybb_forums (
 234    fid serial,
 235    name varchar(120) NOT NULL default '',
 236    description text NOT NULL default '',
 237    linkto varchar(180) NOT NULL default '',
 238    type char(1) NOT NULL default '',
 239    pid smallint NOT NULL default '0',
 240    parentlist text NOT NULL default '',
 241    disporder smallint NOT NULL default '0',
 242    active int NOT NULL default '0',
 243    open int NOT NULL default '0',
 244    threads int NOT NULL default '0',
 245    posts int NOT NULL default '0',
 246    lastpost int NOT NULL default '0',
 247    lastposter varchar(120) NOT NULL default '',
 248    lastposteruid int NOT NULL default '0',
 249    lastposttid int NOT NULL default '0',
 250    lastpostsubject varchar(120) NOT NULL default '',
 251    allowhtml int NOT NULL default '0',
 252    allowmycode int NOT NULL default '0',
 253    allowsmilies int NOT NULL default '0',
 254    allowimgcode int NOT NULL default '0',
 255    allowvideocode int NOT NULL default '0',
 256    allowpicons int NOT NULL default '0',
 257    allowtratings int NOT NULL default '0',
 258    status int NOT NULL default '1',
 259    usepostcounts int NOT NULL default '0',
 260    password varchar(50) NOT NULL default '',
 261    showinjump int NOT NULL default '0',
 262    modposts int NOT NULL default '0',
 263    modthreads int NOT NULL default '0',
 264    mod_edit_posts int NOT NULL default '0',
 265    modattachments int NOT NULL default '0',
 266    style smallint NOT NULL default '0',
 267    overridestyle int NOT NULL default '0',
 268    rulestype smallint NOT NULL default '0',
 269    rulestitle varchar(200) NOT NULL default '',
 270    rules text NOT NULL default '',
 271    unapprovedthreads int NOT NULL default '0',
 272    unapprovedposts int NOT NULL default '0',
 273    defaultdatecut smallint NOT NULL default '0',
 274    defaultsortby varchar(10) NOT NULL default '',
 275    defaultsortorder varchar(4) NOT NULL default '',
 276    PRIMARY KEY (fid)
 277  );";
 278  
 279  $tables[] = "CREATE TABLE mybb_forumsread (
 280    fid int NOT NULL default '0',
 281    uid int NOT NULL default '0',
 282    dateline int NOT NULL default '0'
 283  );";
 284  
 285  $tables[] = "CREATE TABLE mybb_forumsubscriptions (
 286    fsid serial,
 287    fid smallint NOT NULL default '0',
 288    uid int NOT NULL default '0',
 289    PRIMARY KEY (fsid)
 290  );";
 291  
 292  $tables[] = "CREATE TABLE mybb_groupleaders (
 293    lid serial,
 294    gid smallint NOT NULL default '0',
 295    uid int NOT NULL default '0',
 296    canmanagemembers int NOT NULL default '0',
 297    canmanagerequests int NOT NULL default '0',
 298    PRIMARY KEY (lid)
 299  );";
 300  
 301  $tables[] = "CREATE TABLE mybb_helpdocs (
 302    hid serial,
 303    sid smallint NOT NULL default '0',
 304    name varchar(120) NOT NULL default '',
 305    description text NOT NULL default '',
 306    document text NOT NULL default '',
 307    usetranslation int NOT NULL default '0',
 308    enabled int NOT NULL default '0',
 309    disporder smallint NOT NULL default '0',
 310    PRIMARY KEY (hid)
 311  );";
 312  
 313  
 314  $tables[] = "CREATE TABLE mybb_helpsections (
 315    sid serial,
 316    name varchar(120) NOT NULL default '',
 317    description text NOT NULL default '',
 318    usetranslation int NOT NULL default '0',
 319    enabled int NOT NULL default '0',
 320    disporder smallint NOT NULL default '0',
 321    PRIMARY KEY (sid)
 322  );";
 323  
 324  
 325  $tables[] = "CREATE TABLE mybb_icons (
 326    iid serial,
 327    name varchar(120) NOT NULL default '',
 328    path varchar(220) NOT NULL default '',
 329    PRIMARY KEY (iid)
 330  );";
 331  
 332  
 333  $tables[] = "CREATE TABLE mybb_joinrequests (
 334    rid serial,
 335    uid int NOT NULL default '0',
 336    gid smallint NOT NULL default '0',
 337    reason varchar(250) NOT NULL default '',
 338    dateline bigint NOT NULL default '0',
 339    PRIMARY KEY (rid)
 340  );";
 341  
 342  $tables[] = "CREATE TABLE mybb_massemails (
 343      mid serial,
 344      uid int NOT NULL default '0',
 345      subject varchar(200) NOT NULL default '',
 346      message text NOT NULL,
 347      htmlmessage text NOT NULL,
 348      type int2 NOT NULL default '0',
 349      format int2 NOT NULL default '0',
 350      dateline numeric(30,0) NOT NULL default '0',
 351      senddate numeric(30,0) NOT NULL default '0',
 352      status int2 NOT NULL default '0',
 353      sentcount int NOT NULL default '0',
 354      totalcount int NOT NULL default '0',
 355      conditions text NOT NULL,
 356      perpage int NOT NULL default '50',
 357      PRIMARY KEY(mid)
 358  );";
 359  
 360  $tables[] = "CREATE TABLE mybb_mailerrors (
 361    eid serial,
 362    subject varchar(200) NOT NULL default '',
 363    message text NOT NULL default '',
 364    toaddress varchar(150) NOT NULL default '',
 365    fromaddress varchar(150) NOT NULL default '',
 366    dateline bigint NOT NULL default '0',
 367    error text NOT NULL default '',
 368    smtperror varchar(200) NOT NULL default '',
 369    smtpcode int NOT NULL default '0',
 370    PRIMARY KEY(eid)
 371  );";
 372  
 373  $tables[] = "CREATE TABLE mybb_maillogs (
 374      mid serial,
 375      subject varchar(200) not null default '',
 376      message text NOT NULL default '',
 377      dateline bigint NOT NULL default '0',
 378      fromuid int NOT NULL default '0',
 379      fromemail varchar(200) not null default '',
 380      touid bigint NOT NULL default '0',
 381      toemail varchar(200) NOT NULL default '',
 382      tid int NOT NULL default '0',
 383      ipaddress varchar(20) NOT NULL default '',
 384      PRIMARY KEY(mid)
 385  );";
 386  
 387  $tables[] = "CREATE TABLE mybb_mailqueue (
 388      mid serial,
 389      mailto varchar(200) NOT NULL,
 390      mailfrom varchar(200) NOT NULL,
 391      subject varchar(200) NOT NULL,
 392      message text NOT NULL default '',
 393      headers text NOT NULL default '',
 394      PRIMARY KEY(mid)
 395  );";
 396  
 397  $tables[] = "CREATE TABLE mybb_moderatorlog (
 398    uid int NOT NULL default '0',
 399    dateline bigint NOT NULL default '0',
 400    fid smallint NOT NULL default '0',
 401    tid int NOT NULL default '0',
 402    pid int NOT NULL default '0',
 403    action text NOT NULL default '',
 404    data text NOT NULL,
 405    ipaddress varchar(50) NOT NULL default ''
 406  );";
 407  
 408  $tables[] = "CREATE TABLE mybb_moderators (
 409    mid serial,
 410    fid smallint NOT NULL default '0',
 411    id int NOT NULL default '0',
 412    isgroup int NOT NULL default '0',
 413    caneditposts int NOT NULL default '0',
 414    candeleteposts int NOT NULL default '0',
 415    canviewips int NOT NULL default '0',
 416    canopenclosethreads int NOT NULL default '0',
 417    canmanagethreads int NOT NULL default '0',
 418    canmovetononmodforum int NOT NULL default '0',
 419    canusecustomtools int NOT NULL default '0',
 420    PRIMARY KEY (mid)
 421  );";
 422  
 423  $tables[] = "CREATE TABLE mybb_modtools (
 424      tid serial,
 425      name varchar(200) NOT NULL,
 426      description text NOT NULL default '',
 427      forums text NOT NULL default '',
 428      type char(1) NOT NULL default '',
 429      postoptions text NOT NULL default '',
 430      threadoptions text NOT NULL default '',
 431      PRIMARY KEY (tid)
 432  );";
 433  
 434  $tables[] = "CREATE TABLE mybb_mycode (
 435    cid serial,
 436    title varchar(100) NOT NULL default '',
 437    description text NOT NULL default '',
 438    regex text NOT NULL default '',
 439    replacement text NOT NULL default '',
 440    active int NOT NULL default '0',
 441    parseorder smallint NOT NULL default '0',
 442    PRIMARY KEY(cid)
 443  );";
 444  
 445  $tables[] = "CREATE TABLE mybb_polls (
 446    pid serial,
 447    tid int NOT NULL default '0',
 448    question varchar(200) NOT NULL default '',
 449    dateline bigint NOT NULL default '0',
 450    options text NOT NULL default '',
 451    votes text NOT NULL default '',
 452    numoptions smallint NOT NULL default '0',
 453    numvotes text NOT NULL default '0',
 454    timeout bigint NOT NULL default '0',
 455    closed int NOT NULL default '0',
 456    multiple int NOT NULL default '0',
 457    public int NOT NULL default '0',
 458    PRIMARY KEY (pid)
 459  );";
 460  
 461  $tables[] = "CREATE TABLE mybb_pollvotes (
 462    vid serial,
 463    pid int NOT NULL default '0',
 464    uid int NOT NULL default '0',
 465    voteoption smallint NOT NULL default '0',
 466    dateline bigint NOT NULL default '0',
 467    PRIMARY KEY (vid)
 468  );";
 469  
 470  $tables[] = "CREATE TABLE mybb_posts (
 471    pid serial,
 472    tid int NOT NULL default '0',
 473    replyto int NOT NULL default '0',
 474    fid smallint NOT NULL default '0',
 475    subject varchar(120) NOT NULL default '',
 476    icon smallint NOT NULL default '0',
 477    uid int NOT NULL default '0',
 478    username varchar(80) NOT NULL default '',
 479    dateline bigint NOT NULL default '0',
 480    message text NOT NULL default '',
 481    ipaddress varchar(30) NOT NULL default '',
 482    longipaddress int NOT NULL default '0',
 483    includesig int NOT NULL default '0',
 484    smilieoff int NOT NULL default '0',
 485    edituid int NOT NULL default '0',
 486    edittime int NOT NULL default '0',
 487    visible int NOT NULL default '0',
 488    posthash varchar(32) NOT NULL default '',
 489    PRIMARY KEY (pid)
 490  );";
 491  
 492  
 493  $tables[] = "CREATE TABLE mybb_privatemessages (
 494    pmid serial,
 495    uid int NOT NULL default '0',
 496    toid int NOT NULL default '0',
 497    fromid int NOT NULL default '0',
 498    recipients text NOT NULL default '',
 499    folder smallint NOT NULL default '1',
 500    subject varchar(120) NOT NULL default '',
 501    icon smallint NOT NULL default '0',
 502    message text NOT NULL default '',
 503    dateline bigint NOT NULL default '0',
 504    deletetime bigint NOT NULL default '0',
 505    status int NOT NULL default '0',
 506    statustime bigint NOT NULL default '0',
 507    includesig int NOT NULL default '0',
 508    smilieoff int NOT NULL default '0',
 509    receipt int NOT NULL default '0',
 510    readtime bigint NOT NULL default '0',
 511    PRIMARY KEY (pmid)
 512  );";
 513  
 514  
 515  $tables[] = "CREATE TABLE mybb_profilefields (
 516    fid serial,
 517    name varchar(100) NOT NULL default '',
 518    description text NOT NULL default '',
 519    disporder smallint NOT NULL default '0',
 520    type text NOT NULL default '',
 521    length smallint NOT NULL default '0',
 522    maxlength smallint NOT NULL default '0',
 523    required int NOT NULL default '0',
 524    editable int NOT NULL default '0',
 525    hidden int NOT NULL default '0',
 526    postnum int NOT NULL default '0',
 527    PRIMARY KEY (fid)
 528  );";
 529  
 530  
 531  $tables[] = "CREATE TABLE mybb_promotions (
 532    pid serial,
 533    title varchar(120) NOT NULL default '',
 534    description text NOT NULL default '',
 535    enabled int NOT NULL default '1',
 536    logging int NOT NULL default '0',
 537    posts int NOT NULL default '0',
 538    posttype varchar(2) NOT NULL default '',
 539    registered int NOT NULL default '0',
 540    registeredtype varchar(20) NOT NULL default '',
 541    reputations int NOT NULL default '0',
 542    reputationtype varchar(2) NOT NULL default '',
 543    referrals int NOT NULL default '0',
 544    referralstype varchar(2) NOT NULL default '',
 545    requirements varchar(200) NOT NULL default '',
 546    originalusergroup varchar(120) NOT NULL default '0',
 547    newusergroup smallint NOT NULL default '0',
 548    usergrouptype varchar(120) NOT NULL default '0',
 549    PRIMARY KEY(pid)
 550  );";
 551      
 552  $tables[] = "CREATE TABLE mybb_promotionlogs (
 553    plid serial,
 554    pid int NOT NULL default '0',
 555    uid int NOT NULL default '0',
 556    oldusergroup varchar(200) NOT NULL default '0',
 557    newusergroup smallint NOT NULL default '0',
 558    dateline bigint NOT NULL default '0',
 559    type varchar(9) NOT NULL default 'primary',
 560    PRIMARY KEY(plid)
 561  );";
 562  
 563  $tables[] = "CREATE TABLE mybb_reportedposts (
 564    rid serial,
 565    pid int NOT NULL default '0',
 566    tid int NOT NULL default '0',
 567    fid int NOT NULL default '0',
 568    uid int NOT NULL default '0',
 569    reportstatus int NOT NULL default '0',
 570    reason varchar(250) NOT NULL default '',
 571    dateline bigint NOT NULL default '0',
 572    PRIMARY KEY (rid)
 573  );";
 574  
 575  $tables[] = "CREATE TABLE mybb_reputation (
 576    rid serial,
 577    uid int NOT NULL default '0',
 578    adduid int NOT NULL default '0',
 579    pid int NOT NULL default '0',
 580    reputation bigint NOT NULL default '0',
 581    dateline bigint NOT NULL default '0',
 582    comments text NOT NULL default '',
 583    PRIMARY KEY(rid)
 584  );";
 585  
 586  $tables[] = "CREATE TABLE mybb_searchlog (
 587    sid varchar(32) NOT NULL default '',
 588    uid int NOT NULL default '0',
 589    dateline bigint NOT NULL default '0',
 590    ipaddress varchar(120) NOT NULL default '',
 591    threads text NOT NULL default '',
 592    posts text NOT NULL default '',
 593    resulttype varchar(10) NOT NULL default '',
 594    querycache text NOT NULL default '',
 595    keywords text NOT NULL default '',
 596    UNIQUE (sid)
 597  );";
 598  
 599  $tables[] = "CREATE TABLE mybb_sessions (
 600    sid varchar(32) NOT NULL default '',
 601    uid int NOT NULL default '0',
 602    ip varchar(40) NOT NULL default '',
 603    time bigint NOT NULL default '0',
 604    location varchar(150) NOT NULL default '',
 605    useragent varchar(100) NOT NULL default '',
 606    anonymous int NOT NULL default '0',
 607    nopermission int NOT NULL default '0',
 608    location1 int NOT NULL default '0',
 609    location2 int NOT NULL default '0',
 610    UNIQUE (sid)
 611  );";
 612  
 613  $tables[] = "CREATE TABLE mybb_settinggroups (
 614    gid serial,
 615    name varchar(100) NOT NULL default '',
 616    title varchar(220) NOT NULL default '',
 617    description text NOT NULL default '',
 618    disporder smallint NOT NULL default '0',
 619    isdefault int NOT NULL default '0',
 620    PRIMARY KEY (gid)
 621  );";
 622  
 623  
 624  $tables[] = "CREATE TABLE mybb_settings (
 625    sid serial,
 626    name varchar(120) NOT NULL default '',
 627    title varchar(120) NOT NULL default '',
 628    description text NOT NULL default '',
 629    optionscode text NOT NULL default '',
 630    value text NOT NULL default '',
 631    disporder smallint NOT NULL default '0',
 632    gid smallint NOT NULL default '0',
 633    isdefault int NOT NULL default '0',
 634    PRIMARY KEY (sid)
 635  );";
 636  
 637  
 638  $tables[] = "CREATE TABLE mybb_smilies (
 639    sid serial,
 640    name varchar(120) NOT NULL default '',
 641    find varchar(120) NOT NULL default '',
 642    image varchar(220) NOT NULL default '',
 643    disporder smallint NOT NULL default '0',
 644    showclickable int NOT NULL default '0',
 645    PRIMARY KEY (sid)
 646  );";
 647  
 648  $tables[] = "CREATE TABLE mybb_spiders (
 649      sid serial,
 650      name varchar(100) NOT NULL default '',
 651      theme int NOT NULL default '0',
 652      language varchar(20) NOT NULL default '',
 653      usergroup int NOT NULL default '0',
 654      useragent varchar(200) NOT NULL default '',
 655      lastvisit bigint NOT NULL default '0',
 656      PRIMARY KEY(sid)
 657  );";
 658  
 659  $tables[] = "CREATE TABLE mybb_stats (
 660      dateline numeric(30,0) NOT NULL default '0',
 661      numusers numeric(10,0) NOT NULL default '0',
 662      numthreads numeric(10,0) NOT NULL default '0',
 663      numposts numeric(10,0) NOT NULL default '0',
 664      UNIQUE (dateline)
 665  );";
 666      
 667  $tables[] = "CREATE TABLE mybb_tasks (
 668      tid serial,
 669      title varchar(120) NOT NULL default '',
 670      description text NOT NULL default '',
 671      file varchar(30) NOT NULL default '',
 672      minute varchar(200) NOT NULL default '',
 673      hour varchar(200) NOT NULL default '',
 674      day varchar(100) NOT NULL default '',
 675      month varchar(30) NOT NULL default '',
 676      weekday varchar(15) NOT NULL default '',
 677      nextrun bigint NOT NULL default '0',
 678      lastrun bigint NOT NULL default '0',
 679      enabled int NOT NULL default '1',
 680      logging int NOT NULL default '0',
 681      locked bigint NOT NULL default '0',
 682      PRIMARY KEY(tid)
 683  );";
 684  
 685  $tables[] = "CREATE TABLE mybb_tasklog (
 686      lid serial,
 687      tid int NOT NULL default '0',
 688      dateline bigint NOT NULL default '0',
 689      data text NOT NULL,
 690      PRIMARY KEY(lid)
 691  );";
 692  
 693  $tables[] = "CREATE TABLE mybb_templategroups (
 694    gid serial,
 695    prefix varchar(50) NOT NULL default '',
 696    title varchar(100) NOT NULL default '',
 697    PRIMARY KEY (gid)
 698  );";
 699  
 700  $tables[] = "CREATE TABLE mybb_templates (
 701    tid serial,
 702    title varchar(120) NOT NULL default '',
 703    template text NOT NULL default '',
 704    sid int NOT NULL default '0',
 705    version varchar(20) NOT NULL default '0',
 706    status varchar(10) NOT NULL default '',
 707    dateline int NOT NULL default '0',
 708    PRIMARY KEY (tid)
 709  );";
 710  
 711  $tables[] = "CREATE TABLE mybb_templatesets (
 712    sid serial,
 713    title varchar(120) NOT NULL default '',
 714    PRIMARY KEY (sid)
 715  );";
 716  
 717  
 718  $tables[] = "CREATE TABLE mybb_themes (
 719    tid serial,
 720    name varchar(100) NOT NULL default '',
 721    pid smallint NOT NULL default '0',
 722    def smallint NOT NULL default '0',
 723    properties text NOT NULL default '',
 724    stylesheets text NOT NULL default '',
 725    allowedgroups text NOT NULL default '',
 726    PRIMARY KEY (tid)
 727  );";
 728  
 729  $tables[] = "CREATE TABLE mybb_themestylesheets(
 730      sid serial,
 731      name varchar(30) NOT NULL default '',
 732      tid numeric(10,0) NOT NULL default '0',
 733      attachedto text NOT NULL,
 734      stylesheet text NOT NULL,
 735      cachefile varchar(100) NOT NULL default '',
 736      lastmodified numeric(30,0) NOT NULL default '0',
 737      PRIMARY KEY(sid)
 738  );";
 739  
 740  $tables[] = "CREATE TABLE mybb_threadprefixes (
 741      pid serial,
 742      prefix varchar(120) NOT NULL default '',
 743      displaystyle varchar(200) NOT NULL default '',
 744      forums text NOT NULL,
 745      groups text NOT NULL,
 746      PRIMARY KEY(pid)
 747  );";
 748  
 749  $tables[] = "CREATE TABLE mybb_threadratings (
 750    rid serial,
 751    tid int NOT NULL default '0',
 752    uid int NOT NULL default '0',
 753    rating smallint NOT NULL default '0',
 754    ipaddress varchar(30) NOT NULL default '',
 755    PRIMARY KEY (rid)
 756  );";
 757  
 758  $tables[] = "CREATE TABLE mybb_threadviews (
 759      tid int NOT NULL default '0'
 760  );";
 761  
 762  $tables[] = "CREATE TABLE mybb_threads (
 763    tid serial,
 764    fid smallint NOT NULL default '0',
 765    subject varchar(120) NOT NULL default '',
 766    prefix smallint NOT NULL default '0',
 767    icon smallint NOT NULL default '0',
 768    poll int NOT NULL default '0',
 769    uid int NOT NULL default '0',
 770    username varchar(80) NOT NULL default '',
 771    dateline bigint NOT NULL default '0',
 772    firstpost int NOT NULL default '0',
 773    lastpost bigint NOT NULL default '0',
 774    lastposter varchar(120) NOT NULL default '',
 775    lastposteruid int NOT NULL default '0',
 776    views int NOT NULL default '0',
 777    replies int NOT NULL default '0',
 778    closed varchar(30) NOT NULL default '',
 779    sticky int NOT NULL default '0',
 780    numratings smallint NOT NULL default '0',
 781    totalratings smallint NOT NULL default '0',
 782    notes text NOT NULL default '',
 783    visible int NOT NULL default '0',
 784    unapprovedposts int NOT NULL default '0',
 785    attachmentcount int NOT NULL default '0',
 786    deletetime int NOT NULL default '0',
 787    PRIMARY KEY (tid)
 788  );";
 789  
 790  $tables[] = "CREATE TABLE mybb_threadsread (
 791    tid int NOT NULL default '0',
 792    uid int NOT NULL default '0',
 793    dateline int NOT NULL default '0'
 794  );";
 795  
 796  $tables[] = "CREATE TABLE mybb_threadsubscriptions (
 797    sid serial,
 798    uid int NOT NULL default '0',
 799    tid int NOT NULL default '0',
 800    notification int NOT NULL default '0',
 801    dateline bigint NOT NULL default '0',
 802    subscriptionkey varchar(32) NOT NULL default '',
 803    PRIMARY KEY (sid)
 804  );";
 805  
 806  $tables[] = "CREATE TABLE mybb_userfields (
 807    ufid int NOT NULL default '0',
 808    fid1 text NOT NULL default '',
 809    fid2 text NOT NULL default '',
 810    fid3 text NOT NULL default '',
 811    PRIMARY KEY (ufid)
 812  );";
 813  $query = $db->write_query("SELECT column_name
 814                            FROM information_schema.constraint_column_usage
 815                            WHERE table_name = '".$config['tableprefix']."userfields' 
 816                            AND constraint_name = '".$config['tableprefix']."userfields_pkey'
 817                            LIMIT 1");
 818  $main_field = $db->fetch_field($query, 'column_name');
 819  if(!empty($main_field))
 820  {
 821      $tables[] = "DROP SEQUENCE mybb_userfields_ufid_seq;";
 822  }
 823  $tables[] = "CREATE SEQUENCE mybb_userfields_ufid_seq;";
 824  
 825  $tables[] = "CREATE TABLE mybb_usergroups (
 826    gid serial,
 827    type smallint NOT NULL default '2',
 828    title varchar(120) NOT NULL default '',
 829    description text NOT NULL default '',
 830    namestyle varchar(200) NOT NULL default '{username}',
 831    usertitle varchar(120) NOT NULL default '',
 832    stars smallint NOT NULL default '0',
 833    starimage varchar(120) NOT NULL default '',
 834    image varchar(120) NOT NULL default '',
 835    disporder smallint NOT NULL default '0',
 836    isbannedgroup int NOT NULL default '0',
 837    canview int NOT NULL default '0',
 838    canviewthreads int NOT NULL default '0',
 839    canviewprofiles int NOT NULL default '0',
 840    candlattachments int NOT NULL default '0',
 841    canpostthreads int NOT NULL default '0',
 842    canpostreplys int NOT NULL default '0',
 843    canpostattachments int NOT NULL default '0',
 844    canratethreads int NOT NULL default '0',
 845    caneditposts int NOT NULL default '0',
 846    candeleteposts int NOT NULL default '0',
 847    candeletethreads int NOT NULL default '0',
 848    caneditattachments int NOT NULL default '0',
 849    canpostpolls int NOT NULL default '0',
 850    canvotepolls int NOT NULL default '0',
 851    canundovotes int NOT NULL default '0',
 852    canusepms int NOT NULL default '0',
 853    cansendpms int NOT NULL default '0',
 854    cantrackpms int NOT NULL default '0',
 855    candenypmreceipts int NOT NULL default '0',
 856    pmquota int NOT NULL default '0',
 857    maxpmrecipients int NOT NULL default '5',
 858    cansendemail int NOT NULL default '0',
 859    cansendemailoverride int NOT NULL default '0',
 860    maxemails int NOT NULL default '5',
 861    canviewmemberlist int NOT NULL default '0',
 862    canviewcalendar int NOT NULL default '0',
 863    canaddevents int NOT NULL default '0',
 864    canbypasseventmod int NOT NULL default '0',
 865    canmoderateevents int NOT NULL default '0',
 866    canviewonline int NOT NULL default '0',
 867    canviewwolinvis int NOT NULL default '0',
 868    canviewonlineips int NOT NULL default '0',
 869    cancp int NOT NULL default '0',
 870    issupermod int NOT NULL default '0',
 871    cansearch int NOT NULL default '0',
 872    canusercp int NOT NULL default '0',
 873    canuploadavatars int NOT NULL default '0',
 874    canratemembers int NOT NULL default '0',
 875    canchangename int NOT NULL default '0',
 876    showforumteam int NOT NULL default '0',
 877    usereputationsystem int NOT NULL default '0',
 878    cangivereputations int NOT NULL default '0',
 879    reputationpower bigint NOT NULL default '0',
 880    maxreputationsday bigint NOT NULL default '0',
 881    maxreputationsperuser bigint NOT NULL default '0',
 882    maxreputationsperthread bigint NOT NULL default '0',
 883    candisplaygroup int NOT NULL default '0',
 884    attachquota bigint NOT NULL default '0',
 885    cancustomtitle int NOT NULL default '0',
 886    canwarnusers int NOT NULL default '0',
 887    canreceivewarnings int NOT NULL default '0',
 888    maxwarningsday int NOT NULL default '3',
 889    canmodcp int NOT NULL default '0',
 890    showinbirthdaylist int NOT NULL default '0',
 891    canoverridepm int NOT NULL default '0',
 892    canusesig int NOT NULL default '0',
 893    canusesigxposts int NOT NULL default '0',
 894    signofollow int NOT NULL default '0',
 895    PRIMARY KEY (gid)
 896  );";
 897  
 898  
 899  $tables[] = "CREATE TABLE mybb_users (
 900    uid serial,
 901    username varchar(120) NOT NULL default '',
 902    password varchar(120) NOT NULL default '',
 903    salt varchar(10) NOT NULL default '',
 904    loginkey varchar(50) NOT NULL default '',
 905    email varchar(220) NOT NULL default '',
 906    postnum int NOT NULL default '0',
 907    avatar varchar(200) NOT NULL default '',
 908    avatardimensions varchar(10) NOT NULL default '',
 909    avatartype varchar(10) NOT NULL default '0',
 910    usergroup smallint NOT NULL default '0',
 911    additionalgroups varchar(200) NOT NULL default '',
 912    displaygroup smallint NOT NULL default '0',
 913    usertitle varchar(250) NOT NULL default '',
 914    regdate bigint NOT NULL default '0',
 915    lastactive bigint NOT NULL default '0',
 916    lastvisit bigint NOT NULL default '0',
 917    lastpost bigint NOT NULL default '0',
 918    website varchar(200) NOT NULL default '',
 919    icq varchar(10) NOT NULL default '',
 920    aim varchar(50) NOT NULL default '',
 921    yahoo varchar(50) NOT NULL default '',
 922    msn varchar(75) NOT NULL default '',
 923    birthday varchar(15) NOT NULL default '',
 924    birthdayprivacy varchar(4) NOT NULL default 'all',
 925    signature text NOT NULL default '',
 926    allownotices int NOT NULL default '0',
 927    hideemail int NOT NULL default '0',
 928    subscriptionmethod int NOT NULL default '0',
 929    invisible int NOT NULL default '0',
 930    receivepms int NOT NULL default '0',
 931    receivefrombuddy int NOT NULL default '0',
 932    pmnotice int NOT NULL default '0',
 933    pmnotify int NOT NULL default '0',
 934    threadmode varchar(8) NOT NULL default '',
 935    showsigs int NOT NULL default '0',
 936    showavatars int NOT NULL default '0',
 937    showquickreply int NOT NULL default '0',
 938    showredirect int NOT NULL default '0',
 939    ppp smallint NOT NULL default '0',
 940    tpp smallint NOT NULL default '0',
 941    daysprune smallint NOT NULL default '0',
 942    dateformat varchar(4) NOT NULL default '',
 943    timeformat varchar(4) NOT NULL default '',
 944    timezone varchar(4) NOT NULL default '',
 945    dst int NOT NULL default '0',
 946    dstcorrection int NOT NULL default '0',
 947    buddylist text NOT NULL default '',
 948    ignorelist text NOT NULL default '',
 949    style smallint NOT NULL default '0',
 950    away int NOT NULL default '0',
 951    awaydate int NOT NULL default '0',
 952    returndate varchar(15) NOT NULL default '',
 953    awayreason varchar(200) NOT NULL default '',
 954    pmfolders text NOT NULL default '',
 955    notepad text NOT NULL default '',
 956    referrer int NOT NULL default '0',
 957    referrals int NOT NULL default '0',
 958    reputation bigint NOT NULL default '0',
 959    regip varchar(50) NOT NULL default '',
 960    lastip varchar(50) NOT NULL default '',
 961    longregip int NOT NULL default '0',
 962    longlastip int NOT NULL default '0',
 963    language varchar(50) NOT NULL default '',
 964    timeonline bigint NOT NULL default '0',
 965    showcodebuttons int NOT NULL default '1',
 966    totalpms int NOT NULL default '0',
 967    unreadpms int NOT NULL default '0',
 968    warningpoints int NOT NULL default '0',
 969    moderateposts int NOT NULL default '0',
 970    moderationtime bigint NOT NULL default '0',
 971    suspendposting int NOT NULL default '0',
 972    suspensiontime bigint NOT NULL default '0',
 973    suspendsignature int NOT NULL default '0',
 974    suspendsigtime bigint NOT NULL default '0',
 975    coppauser int NOT NULL default '0',
 976    classicpostbit int NOT NULL default '0',
 977    loginattempts smallint NOT NULL default '1',
 978    usernotes text NOT NULL default '',
 979    PRIMARY KEY (uid)
 980  );";
 981  
 982  
 983  $tables[] = "CREATE TABLE mybb_usertitles (
 984    utid serial,
 985    posts int NOT NULL default '0',
 986    title varchar(250) NOT NULL default '',
 987    stars smallint NOT NULL default '0',
 988    starimage varchar(120) NOT NULL default '',
 989    PRIMARY KEY (utid)
 990  );";
 991  
 992  $tables[] = "CREATE TABLE mybb_warninglevels (
 993      lid serial,
 994      percentage int NOT NULL default '0',
 995      action text NOT NULL,
 996      PRIMARY KEY(lid)
 997  );";
 998  
 999  $tables[] = "CREATE TABLE mybb_warningtypes (
1000      tid serial,
1001      title varchar(120) NOT NULL default '',
1002      points int NOT NULL default '0',
1003      expirationtime bigint NOT NULL default '0',
1004      PRIMARY KEY(tid)
1005  );";
1006  
1007  $tables[] = "CREATE TABLE mybb_warnings (
1008      wid serial,
1009      uid int NOT NULL default '0',
1010      tid int NOT NULL default '0',
1011      pid int NOT NULL default '0',
1012      title varchar(120) NOT NULL default '',
1013      points int NOT NULL default '0',
1014      dateline bigint NOT NULL default '0',
1015      issuedby int NOT NULL default '0',
1016      expires bigint NOT NULL default '0',
1017      expired int NOT NULL default '0',
1018      daterevoked bigint NOT NULL default '0',
1019      revokedby int NOT NULL default '0',
1020      revokereason text NOT NULL default '',
1021      notes text NOT NULL default '',
1022      PRIMARY KEY(wid)
1023  );";
1024  
1025  ?>


Generated: Tue Oct 8 19:19:50 2013 Cross-referenced by PHPXref 0.7.1