BrentOzarULTD / soddi

StackOverflow Data Dump Importer. Forked from https://bitbucket.org/bitpusher/soddi/ after the original author passed away.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Users table creation fails with an error

tomershay opened this issue · comments

When trying to import the latest Stackoverflow data files using SODDI v1.5, to MySQL 5.7, the Users table import fails with the error:
Unknown column AccountId in field list

It seems that mysql.sql doesn't define AccountId as part of the Users table. Modifying the table's structure to the following one resolved the problem.

CREATE  TABLE IF NOT EXISTS DUMMY.`users` (
  `Id` INT(11) NOT NULL /* IDENTITY */,
  `AboutMe` TEXT CHARACTER SET 'utf8' NULL DEFAULT NULL ,
  `Age` INT(11) NULL DEFAULT NULL ,
  `CreationDate` DATETIME NOT NULL ,
  `DisplayName` VARCHAR(40) CHARACTER SET 'utf8' NOT NULL ,
  `DownVotes` INT(11) NOT NULL ,
  `EmailHash` VARCHAR(40) CHARACTER SET 'utf8' NULL DEFAULT NULL ,
  `LastAccessDate` DATETIME NOT NULL ,
  `Location` VARCHAR(100) CHARACTER SET 'utf8' NULL DEFAULT NULL ,
  `Reputation` INT(11) NOT NULL ,
  `UpVotes` INT(11) NOT NULL ,
  `Views` INT(11) NOT NULL ,
  `WebsiteUrl` VARCHAR(200) CHARACTER SET 'utf8' NULL DEFAULT NULL,
  `AccountId` INT(11) NOT NULL,
   PRIMARY KEY (`Id`) 
  )
ENGINE = MyISAM
DEFAULT CHARACTER SET = latin1;

OK, cool. If you want to make a pull request, you're welcome to. (I don't use MySQL, so this wouldn't be something we'd fix - nothing against it, just don't have anything handy here to test.) If you don't want to change the code, no worries, just leave a note and we'll leave it as a known issue for MySQL users.