Skip to content

Commit

Permalink
Fix account name migration (#239)
Browse files Browse the repository at this point in the history
  • Loading branch information
boavenn authored Feb 19, 2024
1 parent f9a46fe commit b2d59d9
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -1 +1,7 @@
ALTER TABLE users ADD COLUMN account_name VARCHAR(63) NOT NULL UNIQUE;
ALTER TABLE users ADD COLUMN account_name VARCHAR(63);

UPDATE users SET account_name = SUBSTRING(mail FROM 1 FOR POSITION('@' IN mail) - 1);

ALTER TABLE users ALTER COLUMN account_name SET NOT NULL;

CREATE UNIQUE INDEX users_account_name_index ON users (account_name);

0 comments on commit b2d59d9

Please sign in to comment.