Understanding Schema....help?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • voclain
    Senior Member
    • Aug 2002
    • 411
    • 3.0.3

    [Forum] Understanding Schema....help?

    OK...I've got a few MISSING items in my database. Caused by a hard drive crash and a backup that is not as good as I thought it was.

    I need to do some fixing......

    Take the "contenttype" as an example. When I look down my list of tables in phpmyadmin it is not there. But when I look on my server it's there.

    So...inside of schema I see this:

    $schema['CREATE']['query']['contenttype'] = "
    CREATE TABLE " . TABLE_PREFIX . "contenttype (
    contenttypeid INT UNSIGNED NOT NULL AUTO_INCREMENT,
    class VARBINARY(50) NOT NULL,
    packageid INT UNSIGNED NOT NULL,
    canplace ENUM('0','1') NOT NULL DEFAULT '0',
    cansearch ENUM('0','1') NOT NULL DEFAULT '0',
    cantag ENUM('0','1') DEFAULT '0',
    canattach ENUM('0','1') DEFAULT '0',
    isaggregator ENUM('0', '1') NOT NULL DEFAULT '0',
    PRIMARY KEY (contenttypeid),
    UNIQUE KEY packageclass (packageid, class)
    ) ENGINE = $hightrafficengine
    ";
    $schema['CREATE']['explain']['contenttype'] = sprintf($vbphrase['create_table'], TABLE_PREFIX . "contenttype");
    How do I take that info...and convert it into a QUERY that I can run in PHPMYADMIN and re-make this table?

    I realize that this is totally an easy thing for some.....but for me...I'm learning...and I gotta ask to be able to learn....so I thank you in advance for your help.

    Yours,

    Kirk
  • snakes1100
    Senior Member
    • Aug 2001
    • 1249

    #2
    Code:
    CREATE TABLE contenttype (
    contenttypeid INT UNSIGNED NOT NULL AUTO_INCREMENT,
    class VARBINARY(50) NOT NULL,
    packageid INT UNSIGNED NOT NULL,
    canplace ENUM('0','1') NOT NULL DEFAULT '0',
    cansearch ENUM('0','1') NOT NULL DEFAULT '0',
    cantag ENUM('0','1') DEFAULT '0',
    canattach ENUM('0','1') DEFAULT '0',
    isaggregator ENUM('0', '1') NOT NULL DEFAULT '0',
    PRIMARY KEY (contenttypeid),
    UNIQUE KEY packageclass (packageid, class)
    );
    Gentoo Geek

    Comment

    • voclain
      Senior Member
      • Aug 2002
      • 411
      • 3.0.3

      #3
      Snakes:

      Thanks...but that did not work....I guess I'm going to have to just contact you.....you should get an email from me by next week......still checking....still playing.....

      - - - Updated - - -

      What I did was deleted the old file and created a new...but I think I just caused more problems......I flying blind???

      Kirk

      Comment

      • Hartmut
        Senior Member
        • Nov 2007
        • 2870
        • 4.2.x

        #4
        Which old file?
        No private support, only PM me when I ask for it. Support in the forums only.

        Comment

        • snakes1100
          Senior Member
          • Aug 2001
          • 1249

          #5
          Kirk
          That query simply creates the table, it dont populate it w/ the needed data.
          Gentoo Geek

          Comment

          • voclain
            Senior Member
            • Aug 2002
            • 411
            • 3.0.3

            #6
            YES...that did now work......

            Here is the short story.....

            HD crash....restore database from back up......copy over all files......put back the way it was.

            NOW...when I click on "FORUMS" and it goes to my site....I get this:

            Database error in vBulletin 4.2.0:


            Invalid SQL:


            SELECT contenttype.contenttypeid AS itemid

            FROM contenttype AS contenttype
            INNER JOIN package AS package
            ON package.packageid = contenttype.packageid LEFT JOIN product AS product
            ON product.productid = package.productid
            WHERE
            1 = 1 AND (product.active = '1' OR package.productid = 'vbulletin') AND contenttype.cantag = '1';


            MySQL Error : Table 'fiip_forum.contenttype' doesn't exist
            Error Number : 1146
            Request Date : Monday, November 19th 2012 @ 11:04:54 AM
            Error Date : Monday, November 19th 2012 @ 11:04:54 AM
            Script : http://www.fiip.net/forums/forum.php
            Referrer : http://www.fiip.net/forums/forumdisp...otography-Talk
            IP Address : 68.152.27.119
            Username : Kirk Voclain
            Classname : vB_Database
            MySQL Version : 5.1.65-cll
            I just thought that MAYBE.....I could just re-create that table and BINGO...all would be good. So.....being that is not the case.....WHAT DO I DO NOW?????

            Kirk

            - - - Updated - - -

            Originally posted by Hartmut
            Which old file?
            from within my database:

            contenttype.frm

            Comment

            • Lynne
              Former vBulletin Support
              • Oct 2004
              • 26255

              #7
              Do you have the suite or just the forum?

              Please don't PM or VM me for support - I only help out in the threads.
              vBulletin Manual & vBulletin 4.0 Code Documentation (API)
              Want help modifying your vbulletin forum? Head on over to vbulletin.org
              If I post CSS and you don't know where it goes, throw it into the additional.css template.

              W3Schools <- awesome site for html/css help

              Comment

              • voclain
                Senior Member
                • Aug 2002
                • 411
                • 3.0.3

                #8
                Originally posted by Lynne
                Do you have the suite or just the forum?
                I have just the forum.

                Let me know???

                Kirk

                Comment

                • Hartmut
                  Senior Member
                  • Nov 2007
                  • 2870
                  • 4.2.x

                  #9
                  First of all try to create the missing table with:
                  PHP Code:
                  CREATE TABLE fiip_forum.contenttype (
                   
                  contenttypeid INT UNSIGNED NOT NULL AUTO_INCREMENT,
                   class 
                  VARBINARY(50NOT NULL,
                   
                  packageid INT UNSIGNED NOT NULL,
                   
                  canplace ENUM('0','1'NOT NULL DEFAULT '0',
                   
                  cansearch ENUM('0','1'NOT NULL DEFAULT '0',
                   
                  cantag ENUM('0','1') DEFAULT '0',
                   
                  canattach ENUM('0','1') DEFAULT '0',
                   
                  isaggregator ENUM('0''1'NOT NULL DEFAULT '0',
                   
                  PRIMARY KEY (contenttypeid),
                   
                  UNIQUE KEY packageclass (packageid, class)
                  ); 
                  Afterwards fill it with the default data:
                  PHP Code:
                  INSERT INTO fiip_forum.contenttype (contenttypeid, class, packageidcanplacecansearchcantagcanattachisaggregatorVALUES
                  (1'Post'1'0''1''0''1''0'),
                  (
                  2'Thread'1'0''0''1''0''0'),
                  (
                  3'Forum'1'0''1''0''0''0'),
                  (
                  4'Announcement'1'0''0''0''0''0'),
                  (
                  5'SocialGroupMessage'1'0''1''0''0''0'),
                  (
                  6'SocialGroupDiscussion'1'0''0''0''0''0'),
                  (
                  7'SocialGroup'1'0''1''0''1''0'),
                  (
                  8'Album'1'0''0''0''1''0'),
                  (
                  9'Picture'1'0''0''0''0''0'),
                  (
                  10'PictureComment'1'0''0''0''0''0'),
                  (
                  11'VisitorMessage'1'0''1''0''0''0'),
                  (
                  12'User'1'0''0''0''0''0'),
                  (
                  13'Event'1'0''0''0''0''0'),
                  (
                  14'Calendar'1'0''0''0''0''0'),
                  (
                  15'PrivateMessage'1'0''0''0''0''0'),
                  (
                  16'Infraction'1'0''0''0''0''0'),
                  (
                  17'Signature'1'0''0''0''0''0'),
                  (
                  18'UserNote'1'0''0''0''0''0'); 
                  But I'm not sure that this will fix your issue, I believe that there is more broken than just this.
                  No private support, only PM me when I ask for it. Support in the forums only.

                  Comment

                  widgetinstance 262 (Related Topics) skipped due to lack of content & hide_module_if_empty option.
                  Working...