#This script attempts to upgrade a database from version 0.7-devel to the current version

ALTER TABLE user ADD COLUMN new_pass VARCHAR(32);

ALTER TABLE user ADD COLUMN p_salt VARCHAR(32);

UPDATE user set p_salt = md5(CONCAT(user,rand(now())));

UPDATE user set new_pass = md5(CONCAT(password,p_salt));

ALTER TABLE user DROP COLUMN password;

ALTER TABLE user CHANGE new_pass password VARCHAR(32);

ALTER TABLE user ADD COLUMN pass_reset VARCHAR(16);

ALTER TABLE book CHANGE isbn isbn VARCHAR(13);
