]> Untitled Git - lemmy.git/blob - migrations/2023-07-11-084714_receive_activity_table/down.sql
Split activity table into sent and received parts (fixes #3103) (#3583)
[lemmy.git] / migrations / 2023-07-11-084714_receive_activity_table / down.sql
1 create table activity (
2     id serial primary key,
3     data jsonb not null,
4     local boolean not null default true,
5     published timestamp not null default now(),
6     updated timestamp,
7     ap_id text not null,
8     sensitive boolean not null default true
9 );
10
11 insert into activity(ap_id, data, sensitive, published)
12     select ap_id, data, sensitive, published
13     from sent_activity
14     order by id desc
15     limit 100000;
16
17 -- We cant copy received_activity entries back into activities table because we dont have data
18 -- which is mandatory.
19
20 drop table sent_activity;
21 drop table received_activity;