]> Untitled Git - lemmy.git/blob - migrations/2023-07-11-084714_receive_activity_table/down.sql
add enable_federated_downvotes site option
[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
13     ap_id,
14     data,
15     sensitive,
16     published
17 FROM
18     sent_activity
19 ORDER BY
20     id DESC
21 LIMIT 100000;
22
23 -- We cant copy received_activity entries back into activities table because we dont have data
24 -- which is mandatory.
25 DROP TABLE sent_activity;
26
27 DROP TABLE received_activity;
28