mirror of
https://github.com/LemmyNet/lemmy.git
synced 2024-11-26 22:31:20 +00:00
36 lines
594 B
SQL
36 lines
594 B
SQL
-- set all column values to null to reclaim disk space
|
|
-- https://dba.stackexchange.com/a/117513
|
|
ALTER TABLE post_like
|
|
ALTER COLUMN published DROP NOT NULL;
|
|
|
|
UPDATE
|
|
post_like
|
|
SET
|
|
published = NULL;
|
|
|
|
ALTER TABLE comment_like
|
|
ALTER COLUMN published DROP NOT NULL;
|
|
|
|
UPDATE
|
|
comment_like
|
|
SET
|
|
published = NULL;
|
|
|
|
ALTER TABLE comment_like
|
|
ALTER COLUMN post_id DROP NOT NULL;
|
|
|
|
UPDATE
|
|
post_like
|
|
SET
|
|
post_id = NULL;
|
|
|
|
-- drop the columns
|
|
ALTER TABLE post_like
|
|
DROP published;
|
|
|
|
ALTER TABLE comment_like
|
|
DROP published;
|
|
|
|
ALTER TABLE comment_like
|
|
DROP post_id;
|
|
|