1.2.8.sql 1.2 KB

1234567891011121314151617181920212223242526272829303132333435
  1. CREATE TABLE IF NOT EXISTS `mlg_nascustom` (
  2. `id` int(11) NOT NULL AUTO_INCREMENT,
  3. `ip` varchar(32) NOT NULL,
  4. `name` varchar(64) NOT NULL,
  5. `secret` varchar(64) NOT NULL,
  6. PRIMARY KEY (`id`)
  7. ) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
  8. CREATE OR REPLACE VIEW `mlg_clients` (`nasname`, `shortname`, `type`, `ports`, `secret`, `server`) AS
  9. SELECT DISTINCT
  10. COALESCE(mlg_nascustom.ip, nas.`nasip`, NULL) AS `nasname`,
  11. COALESCE(mlg_nascustom.name, nas.`nasname`, NULL) AS `shortname`,
  12. 'other' AS `type`,
  13. NULL AS `ports`,
  14. COALESCE(mlg_nascustom.secret, left(md5(inet_aton(nas.`nasip`)),12), NULL) AS `secret`,
  15. NULL AS `server`
  16. from `nas`
  17. left join mlg_nascustom on (nas.nasip = mlg_nascustom.ip)
  18. GROUP BY nasname
  19. UNION SELECT DISTINCT
  20. `ip` AS `nasname`,
  21. `name` AS `shortname`,
  22. 'other' AS `type`,
  23. NULL AS `ports`,
  24. `secret` as `secret`,
  25. NULL as `server`
  26. from `mlg_nascustom`
  27. LEFT JOIN nas ON (mlg_nascustom.ip = nas.nasip)
  28. where nasname is null
  29. GROUP BY `ip`;
  30. UPDATE `sms_services` SET `api_file_name` = 'SmsClubMobi' WHERE `api_file_name` = 'MobiClubSms';
  31. -- must be last query in this update
  32. ALTER TABLE `mlg_acct` CHANGE `nasportid` `nasportid` VARCHAR(120) NULL DEFAULT NULL;