The deleted user username will be changed to 'deleted_'
plus the 13 initial characters of the standard format user_id.
Email, hashed password and API key are all cleared for the user.
The endpoint is currently only available through /api/users/me
and only allows a logged-in user to delete their own account.
Apart from adding the delete-related columns, this migration replaces
the existing unique constraint on the username with a unique index
which has a WHERE clause, so that deleted usernames need not be unique.
This is to avoid having to implement a special function for generating
unique IDs just to keep the deleted username unique and under 30 chars.
The deleted username can still use e.g. the initial part of the user_id
but the uniqueness is not required.
The deleted user username will be changed to 'deleted_'
plus the 13 initial characters of the standard format user_id.
Email, hashed password and API key are all cleared for the user.
The endpoint is currently only available through /api/users/me
and only allows a logged-in user to delete their own account.
Apart from adding the delete-related columns, this migration replaces
the existing unique constraint on the username with a unique index
which has a WHERE clause, so that deleted usernames need not be unique.
This is to avoid having to implement a special function for generating
unique IDs just to keep the deleted username unique and under 30 chars.
The deleted username can still use e.g. the initial part of the user_id
but the uniqueness is not required.
The forms calling the API had an unnecessary form action and method.
This is because the forms have an onSubmit hook calling preventDefault.
The attributes were removed to avoid confusion.
Most errors highglighted by TS were due to a lack of type definitions
and were ignored by settings types to `any`.
Some minor bugs were resolved where the fix was obvious.
TODO marks left where `any` needs to be later removed or bugfix verified