diff --git a/db/db.code.version.txt b/db/db.code.version.txt index 3bc92d44..8f897c85 100644 --- a/db/db.code.version.txt +++ b/db/db.code.version.txt @@ -1 +1 @@ -201 +202 diff --git a/db/db.update.202.sql b/db/db.update.202.sql new file mode 100644 index 00000000..f45f93d3 --- /dev/null +++ b/db/db.update.202.sql @@ -0,0 +1,4 @@ +ALTER TABLE `accounts` ADD `link_username_to_email` ENUM( 'yes', 'no' ) NOT NULL AFTER `username` ; +UPDATE `accounts` SET `link_username_to_email`='yes'; +UPDATE `accounts` SET `link_username_to_email`='no' WHERE `username`!=`email`; +