diff --git a/db/db.update.198.sql b/db/db.update.198.sql index b746a0c..07e491f 100644 --- a/db/db.update.198.sql +++ b/db/db.update.198.sql @@ -34,3 +34,13 @@ DROP TABLE `users_conferences_link`; -- Add conferences ID to users ALTER TABLE `users` ADD `conferences_id` INT NOT NULL AFTER `accounts_id`; + +-- Change the (unique) index in the users table from (username,year) +-- to (accounts_id,conferences_id) +ALTER TABLE `users` DROP INDEX `username`; +ALTER TABLE `users` ADD UNIQUE (`accounts_id` , `conferences_id`); + +-- Add deleted/deleted_datetime data to the accounts table +ALTER TABLE `accounts` ADD `deleted` ENUM( 'no', 'yes' ) NOT NULL DEFAULT 'no' AFTER `superuser`; +ALTER TABLE `accounts` ADD `deleted_datetime` DATETIME NOT NULL AFTER `deleted`; +UPDATE `accounts` SET `deleted`='no';