2023-03-08 10:32:18 +01:00
|
|
|
-- 2023-03-07: add delete functionality
|
|
|
|
|
2023-08-16 03:30:34 +02:00
|
|
|
-- +migrate Up
|
|
|
|
|
2023-03-08 10:32:18 +01:00
|
|
|
-- if not null, the user is soft deleted
|
|
|
|
alter table users add column deleted_at timestamptz;
|
|
|
|
-- if true, the user deleted their account themselves + should have option to reactivate; should also be deleted after 30 days
|
|
|
|
alter table users add column self_delete boolean;
|
|
|
|
-- delete reason if the user was deleted by a moderator
|
|
|
|
alter table users add column delete_reason text;
|
2023-08-16 03:30:34 +02:00
|
|
|
|
|
|
|
-- +migrate Down
|
|
|
|
|
|
|
|
alter table users drop column deleted_at;
|
|
|
|
alter table users drop column self_delete;
|
|
|
|
alter table users drop column delete_reason;
|