CREATE TABLE `UserOAuth` (
  `id` INT(10) UNSIGNED NOT NULL AUTO_INCREMENT,
  `userId` INT(10) UNSIGNED NULL,
  `service` VARCHAR(45) NOT NULL,
  `oAuthId` VARCHAR(45) NOT NULL,
  `oAuthToken` VARCHAR(256) NOT NULL,
  PRIMARY KEY (`id`))
  ENGINE = InnoDB
  DEFAULT CHARACTER SET = utf8;


ALTER TABLE `UserOAuth`
ADD CONSTRAINT `fk_userId_User_id` FOREIGN KEY (`userId`) REFERENCES `User` (`id`) ON UPDATE NO ACTION ON DELETE NO ACTION;
ALTER TABLE `UserOAuth`
ADD INDEX `oAuthId` (`oAuthId`);