Skip to content
Snippets Groups Projects
Commit d96f01bc authored by Sebastian Kehr's avatar Sebastian Kehr :rowboat_tone2: Committed by Dorian Merz
Browse files

refs #16234 [fid_adlr] changes in DB migration script

* drop column username_id after copying to username
* drop user_id_key unique key constraint
* set default values on columns firstname, lastname, cat_username
parent 2e4985ad
No related merge requests found
...@@ -93,9 +93,21 @@ ALTER TABLE user ...@@ -93,9 +93,21 @@ ALTER TABLE user
MODIFY COLUMN expiry_date datetime NOT NULL DEFAULT '2000-01-01 00:00:00', MODIFY COLUMN expiry_date datetime NOT NULL DEFAULT '2000-01-01 00:00:00',
MODIFY COLUMN created datetime NOT NULL DEFAULT '2000-01-01 00:00:00'; MODIFY COLUMN created datetime NOT NULL DEFAULT '2000-01-01 00:00:00';
-- Drop unique key contraint involving columns "username" and "username_id"
ALTER TABLE user DROP INDEX user_id_key;
-- Fill column "username" with content of column "username_id" and set default values for columnls firstname, lastname, cat_username
UPDATE user SET username=username_id,
firstname='',
lastname='',
cat_username=NULL;
-- Drop columns which are not part of the vufind5 structure anymore -- Drop columns which are not part of the vufind5 structure anymore
ALTER TABLE user ALTER TABLE user
DROP COLUMN username_id,
DROP COLUMN liberoid, DROP COLUMN liberoid,
DROP COLUMN attention, DROP COLUMN attention,
DROP COLUMN business_phone, DROP COLUMN business_phone,
...@@ -121,10 +133,6 @@ ALTER TABLE user ...@@ -121,10 +133,6 @@ ALTER TABLE user
DROP COLUMN bibid, DROP COLUMN bibid,
DROP COLUMN updated; DROP COLUMN updated;
-- Fill column "username" with content of column "id"
UPDATE user SET username=id;
-- Set the password columns to default values for all rows -- Set the password columns to default values for all rows
UPDATE user SET password=''; UPDATE user SET password='';
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment