mirror of
https://github.com/LemmyNet/lemmy.git
synced 2024-12-24 20:01:34 +00:00
be1389420b
* SQL format checking, 1. * SQL format checking, 2. * SQL format checking, 3. * SQL format checking, 4. * SQL format checking, 5. * Running pg_format * Getting rid of comment. * Upping pg_format version. * Using git ls-files for sql format check. * Fixing sql lints. * Addressing PR comments.
28 lines
610 B
SQL
28 lines
610 B
SQL
CREATE TABLE activity (
|
|
id serial PRIMARY KEY,
|
|
data jsonb NOT NULL,
|
|
local boolean NOT NULL DEFAULT TRUE,
|
|
published timestamp NOT NULL DEFAULT now(),
|
|
updated timestamp,
|
|
ap_id text NOT NULL,
|
|
sensitive boolean NOT NULL DEFAULT TRUE
|
|
);
|
|
|
|
INSERT INTO activity (ap_id, data, sensitive, published)
|
|
SELECT
|
|
ap_id,
|
|
data,
|
|
sensitive,
|
|
published
|
|
FROM
|
|
sent_activity
|
|
ORDER BY
|
|
id DESC
|
|
LIMIT 100000;
|
|
|
|
-- We cant copy received_activity entries back into activities table because we dont have data
|
|
-- which is mandatory.
|
|
DROP TABLE sent_activity;
|
|
|
|
DROP TABLE received_activity;
|
|
|