Single-sign-on and self-serve account management. https://netsyms.biz/apps/accounthub
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

2.1_2.2.sql 1.6KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. /*
  2. * This Source Code Form is subject to the terms of the Mozilla Public
  3. * License, v. 2.0. If a copy of the MPL was not distributed with this
  4. * file, You can obtain one at http://mozilla.org/MPL/2.0/.
  5. */
  6. DROP TABLE IF EXISTS `available_apps`;
  7. DROP TABLE IF EXISTS `apps`;
  8. CREATE TABLE IF NOT EXISTS `userloginkeys` (
  9. `id` INT(11) NOT NULL AUTO_INCREMENT,
  10. `key` VARCHAR(255) NOT NULL,
  11. `expires` DATETIME NULL DEFAULT NULL,
  12. `uid` INT(11) NULL DEFAULT NULL,
  13. PRIMARY KEY (`id`, `key`),
  14. UNIQUE INDEX `id_UNIQUE` (`id` ASC),
  15. UNIQUE INDEX `key_UNIQUE` (`key` ASC),
  16. INDEX `fk_userloginkeys_accounts1_idx` (`uid` ASC),
  17. CONSTRAINT `fk_userloginkeys_accounts1`
  18. FOREIGN KEY (`uid`)
  19. REFERENCES `accounts` (`uid`)
  20. ON DELETE NO ACTION
  21. ON UPDATE NO ACTION)
  22. ENGINE = InnoDB
  23. DEFAULT CHARACTER SET = utf8;
  24. ALTER TABLE `userloginkeys`
  25. ADD COLUMN `appname` VARCHAR(255) NOT NULL AFTER `uid`;
  26. ALTER TABLE `userloginkeys`
  27. ADD COLUMN `appicon` TINYTEXT NULL DEFAULT NULL AFTER `appname`;
  28. ALTER TABLE `apikeys`
  29. ADD COLUMN `type` VARCHAR(45) NOT NULL DEFAULT 'FULL' AFTER `notes`;
  30. CREATE TABLE IF NOT EXISTS `apppasswords` (
  31. `passid` INT(11) NOT NULL AUTO_INCREMENT,
  32. `hash` VARCHAR(255) NOT NULL,
  33. `uid` INT(11) NOT NULL,
  34. `description` VARCHAR(255) NOT NULL,
  35. PRIMARY KEY (`passid`, `uid`),
  36. UNIQUE INDEX `passid_UNIQUE` (`passid` ASC),
  37. INDEX `fk_apppasswords_accounts1_idx` (`uid` ASC),
  38. CONSTRAINT `fk_apppasswords_accounts1`
  39. FOREIGN KEY (`uid`)
  40. REFERENCES `accounts` (`uid`)
  41. ON DELETE NO ACTION
  42. ON UPDATE NO ACTION)
  43. ENGINE = InnoDB
  44. DEFAULT CHARACTER SET = utf8;