Adding back a table after deletion

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • bjorkfan19
    Member
    • Nov 2002
    • 88
    • 3.5.0 Pre-Release

    Adding back a table after deletion

    I don't have manual access to my database at the moment (host mix-up), but recently had the attachments table deleted. This is preventing any threads from being viewed and I need to add it back to sate all the references to it. Is there a way to rebuild this through any of the vBulletin scripts?
  • Steve Machol
    Former Customer Support Manager
    • Jul 2000
    • 154488

    #2
    I believe this query will recreate a new attachment table for you. Backup your database first.

    CREATE TABLE attachment (
    attachmentid smallint(5) unsigned DEFAULT '0' NOT NULL auto_increment,
    userid int(10) unsigned DEFAULT '0' NOT NULL,
    dateline int(10) unsigned DEFAULT '0' NOT NULL,
    filename varchar(100) NOT NULL,
    filedata mediumtext NOT NULL,
    visible smallint(5) unsigned DEFAULT '0' NOT NULL,
    counter smallint(5) unsigned DEFAULT '0' NOT NULL,
    PRIMARY KEY (attachmentid)
    Steve Machol, former vBulletin Customer Support Manager (and NOT retired!)
    Change CKEditor Colors to Match Style (for 4.1.4 and above)

    Steve Machol Photography


    Mankind is the only creature smart enough to know its own history, and dumb enough to ignore it.


    Comment

    • bjorkfan19
      Member
      • Nov 2002
      • 88
      • 3.5.0 Pre-Release

      #3
      Originally posted by Steve Machol
      I believe this query will recreate a new attachment table for you. Backup your database first.

      CREATE TABLE attachment (
      attachmentid smallint(5) unsigned DEFAULT '0' NOT NULL auto_increment,
      userid int(10) unsigned DEFAULT '0' NOT NULL,
      dateline int(10) unsigned DEFAULT '0' NOT NULL,
      filename varchar(100) NOT NULL,
      filedata mediumtext NOT NULL,
      visible smallint(5) unsigned DEFAULT '0' NOT NULL,
      counter smallint(5) unsigned DEFAULT '0' NOT NULL,
      PRIMARY KEY (attachmentid)
      MySQL said:
      You have an error in your SQL syntax near '' at line 1

      Comment

      • Wayne Luke
        vBulletin Technical Support Lead
        • Aug 2000
        • 74161

        #4
        Originally posted by bjorkfan19
        MySQL said:
        You have an error in your SQL syntax near '' at line 1
        You need to add another ) at the very end.
        Translations provided by Google.

        Wayne Luke
        The Rabid Badger - a vBulletin Cloud demonstration site.
        vBulletin 5 API

        Comment

        • Steve Machol
          Former Customer Support Manager
          • Jul 2000
          • 154488

          #5
          Good catch Wayne!
          Code:
          CREATE TABLE attachment (
          attachmentid smallint(5) unsigned DEFAULT '0' NOT NULL auto_increment,
          userid int(10) unsigned DEFAULT '0' NOT NULL,
          dateline int(10) unsigned DEFAULT '0' NOT NULL,
          filename varchar(100) NOT NULL,
          filedata mediumtext NOT NULL,
          visible smallint(5) unsigned DEFAULT '0' NOT NULL,
          counter smallint(5) unsigned DEFAULT '0' NOT NULL,
          PRIMARY KEY (attachmentid) )
          Steve Machol, former vBulletin Customer Support Manager (and NOT retired!)
          Change CKEditor Colors to Match Style (for 4.1.4 and above)

          Steve Machol Photography


          Mankind is the only creature smart enough to know its own history, and dumb enough to ignore it.


          Comment

          • bjorkfan19
            Member
            • Nov 2002
            • 88
            • 3.5.0 Pre-Release

            #6
            Thanks.

            Comment

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