2023-08-02 16:44:51 +00:00
|
|
|
CREATE TABLE activity (
|
|
|
|
id serial PRIMARY KEY,
|
|
|
|
data jsonb NOT NULL,
|
|
|
|
local boolean NOT NULL DEFAULT TRUE,
|
|
|
|
published timestamp NOT NULL DEFAULT now(),
|
2023-07-14 15:17:06 +00:00
|
|
|
updated timestamp,
|
2023-08-02 16:44:51 +00:00
|
|
|
ap_id text NOT NULL,
|
|
|
|
sensitive boolean NOT NULL DEFAULT TRUE
|
2023-07-14 15:17:06 +00:00
|
|
|
);
|
|
|
|
|
2023-08-02 16:44:51 +00:00
|
|
|
INSERT INTO activity (ap_id, data, sensitive, published)
|
|
|
|
SELECT
|
|
|
|
ap_id,
|
|
|
|
data,
|
|
|
|
sensitive,
|
|
|
|
published
|
|
|
|
FROM
|
|
|
|
sent_activity
|
|
|
|
ORDER BY
|
|
|
|
id DESC
|
|
|
|
LIMIT 100000;
|
2023-07-14 15:17:06 +00:00
|
|
|
|
|
|
|
-- We cant copy received_activity entries back into activities table because we dont have data
|
|
|
|
-- which is mandatory.
|
2023-08-02 16:44:51 +00:00
|
|
|
DROP TABLE sent_activity;
|
|
|
|
|
|
|
|
DROP TABLE received_activity;
|
2023-07-14 15:17:06 +00:00
|
|
|
|
2024-05-17 20:21:13 +00:00
|
|
|
CREATE UNIQUE INDEX idx_activity_ap_id ON activity (ap_id);
|
|
|
|
|