summaryrefslogtreecommitdiff
path: root/schema.sql
diff options
context:
space:
mode:
Diffstat (limited to 'schema.sql')
-rw-r--r--schema.sql12
1 files changed, 12 insertions, 0 deletions
diff --git a/schema.sql b/schema.sql
index dee4356..0ff0cc2 100644
--- a/schema.sql
+++ b/schema.sql
@@ -425,3 +425,15 @@ create trigger trigger_mark_threads_as_unread2 after update on posts
begin
delete from read_threads where user_id != new.author_id and thread_id = new.thread_id;
end;
+
+create table if not exists deleted_users (
+ user_id integer primary key,
+ name text collate nocase,
+ mail text collate nocase,
+ time real default (julianday())
+);
+
+drop trigger if exists trigger_log_deleted_users;
+create trigger trigger_log_deleted_users before delete on users begin
+ insert into deleted_users (user_id, name, mail) values (old.user_id, old.name, old.mail);
+end;