upgrade_svn12975_view.sql 1.1 KB

1234567891011121314151617
  1. -- The statements below will create a 'view' (virtual table) that mimics
  2. -- the previous `login` table layout. You can use this hack to make your db
  3. -- compatible with older *Athena servers or control panels.
  4. -- Note: also adjust the account.sql.account_db setting in login_athena.conf.
  5. -- Note: if your CP does not have a config setting for the `login` table name
  6. -- you'll have to either modify its code or do some table renaming.
  7. START TRANSACTION;
  8. -- create dummy columns, needed to make the view insertable
  9. ALTER TABLE `login` ADD `error_message` SMALLINT UNSIGNED NOT NULL DEFAULT '0';
  10. ALTER TABLE `login` ADD `memo` SMALLINT UNSIGNED NOT NULL DEFAULT '0';
  11. -- create the view
  12. CREATE VIEW `login_view` ( `account_id`, `userid`, `user_pass`, `lastlogin`, `sex`, `logincount`, `email`, `level`, `error_message`, `connect_until`, `last_ip`, `memo`, `ban_until`, `state` ) AS SELECT `account_id`, `userid`, `user_pass`, `lastlogin`, `sex`, `logincount`, `email`, `level`, `error_message`, `expiration_time`, `last_ip`, `memo`, `unban_time`, `state` FROM `login`;
  13. COMMIT;