Announcement

Collapse
No announcement yet.

Adding back a table after deletion

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • 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?

  • #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


    • #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


      • #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 customization and demonstration site.
        vBulletin 5 Documentation - Updated every Friday. Report issues here.
        vBulletin 5 API - Full / Mobile
        I am not currently available for vB Messenger Chats.

        Comment


        • #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


          • #6
            Thanks.

            Comment

            Loading...
            Working...
            X